Java for Simulation

I wanted to seek people's advice on using Java for simulation of physical/numerical processes, for example (but not only), Monte Carlo simulations. Are there any distinct advantages/disadvantages in using Java over, say, Fortran, C++ or other, more common (indeed, more "acceptable") languages used for simulation?
I am not asking in regard to any specific problem, but in general. There must be people here who have a lot of experience in this area, and can offer some advice (eg. "Learn another language"), or point out things that I would never think of.
(I did a brief search for this, but only found questions relating to specific aspects of specific projects.)
Thanks :)

These comments are really good, and just what I was after :)
The obvious answer is that the order of raw speed will be, from fastest to slowest, FORTRAN, C, C++, Java. You already know this. [...]
The advantage [...] is object-oriented abstraction
This is probably at the core of it. I'd read that for most applications, speed is not too much of issue. I would probably comprimise speed if it meant I spent less time debugging and making sure it actually worked like it should (the worst bugs are the non-fatal ones). But for all I know that could change significantly for simulations. I guess there's also native compilers if speed is really slowing things down. (Do they help? Do people use them?)
The Colt distribution covers some areas good for sumulations not in the "standard" Java API's...
I use it a lot, it's very nice :)
What about using a mix of Java and other libraries, like Fortran or MatLab, for example? Is this widely done, or is it better to keep it all in one language?
As for the built in memory management, I hadn't actually thought about that.
I've picked up the impression somewhere along the line (I'm technically a student, see) that Java isn't a simulation language - to stick with Fortran, C or C++. I did deliberately post in a Java forum, not so much to get bias the other way, but to get a wider view. And also because I really like the language.
Incidentally, would anyone recommend any books on the subject?

Similar Messages

  • [ANE] Repacking for simulator and fake support of device

    Hello,
    I have a question about anes, here is my problem : Some of the anes I use don't have simulator support or all-device support (only android, only iOS,...)
    In my code, I of course test the device before calling anything so its fine from a runtime point of view (never had a runtime issue).
    But, it does refuse to compile/launch. I know I could use multiple projects, compiler constants for imports, blablabla, but the best way to increase productivity would be to have them support all-device and simulator even if they do nothing with it.
    So what I tried :
    - rename ane as zip
    - edit extensions.xml, add proper stuff
    - rezip and rename back, and of course, don't call anything in the ane if you know your support is just "fake" for that device
    It works for simulator BUT if I use the rezipped ane in a iOS build (which was supported), it refuses to build a release. So I have to switch ane back and forth.
    It doesn't work if trying to add iOS support (well it compiles but when installing on device, install never ends). I tried adding a fake library.swf for iOS with only empty functions but didn't work.
    Haven't encountered the case where I need to add new Android support so I can't say for that one.
    Anyone knows of a quick way (which doesn't involve recreating all the concerned anes, since I don't have source code for them) ? Would create a huge productivity boost here.
    I hope question is clear enough.

    Understand that I'm not going to tell you that what you want is wrong. There's nothing wrong with wanting Flash on a tablet. The only problem is that the future of Flash no longer exists for tablets.
    fredfromewa wrote:
    So, does anyone know if real Java and Flash support is indeed coming in the future or am I going to have to either return or sell these IPADS and go switch a competitor...
    You can go to a competitor, but it won't help you in the long run since Adobe Flash on mobile is dead, and by the hand of Adobe themselves, not Apple. Here's the official announcement from 2 months ago:
    Adobe Abandons Mobile Flash, Backs HTML5
    You do have one alternative left: Buy a Windows-based tablet now. Why now? Because in mobile versions of Windows 8, Microsoft will no longer allow plug-ins like Flash:
    Microsoft Follows Apple, Bans Flash From Windows 8 Tablet Software
    In fact, even Microsoft's own Flash competitor, Silverlight, will not be allowed to run in tablet versions of Windows 8, only in desktop Windows.
    In the end, your last alternative will be to buy a Windows-based tablet that, ironically, does not run the tablet version of Windows, and then never upgrade it to Windows 8 mobile. You will probably be able to be run Flash then. But since the tablet will run desktop Windows, have fun with 30 minutes of battery life, maybe less after you boot Flash...
    fredfromewa wrote:
    ....they could easily have a much larger majority of the market with tablets by supporting Java and Flash.
    Uh...all the way up to now, the iPad practically has the entire tablet market to itself. How is it possible that Flash would have made that significantly larger?
    Seen from a different perspective...how is it that all the tablets that support Flash have completely failed to make a dent in the tablet market?
    Neither angle seems to support what you're saying.

  • How does the Java Card simulator work? (Using NetBeans)

    Hi,
    I'm using NetBeans and am trying to simulate:
    Someone powering up the card, saving a value, and powering down... And then they power it up again, get the value, and power down.
    When I edit my APDU script to do the second part, the value I entered the first time is never stored, which probably means that when I 'run' my code, my application is loaded and everything is initialized again.
    How do I edit NetBeans to not install the application every time I hit 'run'? And not to initialize the values, so that when i power it up again, I can get a value stored in a previous running of a script?
    When I use powerup, powerdown and then powerup again, NetBeans doesn't powerup the simulator the second time. So understanding the Java Card Simulator would also help... where it is, how it runs, what options it runs with, etc.

    Hi Shane,
    I have not read anywhere else that the JC3 cards are not available, thank you so much for that tip! I am not doing it for research, but I am working on this alone and will have to deploy a card later on. I will be getting all the right versions now.
    I'll ask the question then, using just the JCDK:
    If I want to save a value on the card, and then need it at a later time, how do I go about it. Do I do the following?
    (1) Install the application on the card. (I know how to do this)
    (2) Run the simulator using -o "eeprom data filename"
    (3) Save the value using the APDU calls and Java code on the card + close connection.
    Code:
    public class MyApp extends Applet {
        private static byte[] data = {0x00, 0x00, 0x00};
        // Install method, method to register, process method that can call saveData or recallData, etc
        public static void saveData()
           // code to change data
           data = {0x01, 0x01, 0x01};
        public static byte[] recallData()
           // code to return data
           return data;
    }(4) Run the simulator using -i "eeprom data filename". get the value using recallData().
    Will selecting the app not make data initialize to {0x00, 0x00, 0x00} again?
    If I know this is the correct way of going about it, then I can work towards it getting done.
    From other examples I can see that this is probably the way it should work, but my data array always returns as {0x00, 0x00, 0x00}.

  • Java card simulator and WTK communication problem.

    Hi ,
    I am a newbie to java card .I am doing project on java card based sim.
    For that I am using JavaCard SDK 2.2.2 and WTK 2.5.2 .
    Now when i am trying to connect to cref(java card simulator) from java card midlet,I am getting protocol mismatch error.This is because of WTK runs on slot T=0 and cref runs on T=1.
    then i tried with jcdk3.0.1 classic edition.It provides cref configured to run on both slots T=0 and T=1.
    But when I tried to deploy jcrmi applet on cref running on T=0 i am getting the same error "Protocol mismatch error".
    Can anybody please tell, if there is any way to configure cref to run with T=0?
    Please reply ASAP, as i am stucked with the problem from more than a month.
    Thanks in advance,
    Saviy

    Thanks Anki for replying.
    I am trying to run RMISample from development kit.With steps given in guide as follows
    1.cref -o demoee
    2.Navigate to the
    JC_CLASSIC_HOME\samples\classic_applets\RMIPurse\applet
    directory.
    3.ant all
    it works fine but when i do it with following steps:
    1.cref -o -t0 demoee
    2.Navigate to the
    JC_CLASSIC_HOME\samples\classic_applets\RMIPurse\applet
    directory.
    3.ant all
    i am getting protocol mismatch error.

  • Is there an equivalent statement in Java for this PL/SQL stmt?

    Hi,
    I want to know if there is an equivalent statement
    in java for this PL/SQL statement:
    IF strTok IN('COM-1','COM-2','COM-3') Then
    /* Do Something */
    End If;
    I tried using : // This is giving me errors..
    if (strTok.equals(("COM-1") || ("COM-2") || ("COM-3") ) )
    /* Do Something */
    The above Java code is giving me errors.
    Any Help to reduce the number of steps for comparison
    is appreciated.
    thanks in adv
    Sharath

    Something like
    if (strTok.equals("COM-1") ||
        strTok.equals("COM-2") ||
        strTok.equals("COM-3") )Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to get the last inserted Autoincrement value in Java for Pervasive DB

    Hi, I need to get the last inserted auto incremented value after the record is inserted IN JAVA For ex. consider we have 4 columns for the myTable in the PERVASIVE DATABASE V10 autoid - identity column (auto increment column) userID userName pageID insertSqlExpression = insert into myTable (userID , userName, pageID) values( ? ,? ,?); prepareInsert = connection.prepareStatement(insertSqlExpression); prepareInsert .excuteUpdate; After inserting the new record how can I get the autoid value (last inserted value) in the Java. Please help me.
    Thanks in advance. Arthik

    JavaArthikBabu wrote:
    I dont have privileges to write new stored procedures in database.I need to do in the Java side only. In many databases that irrelevant. The same way you would do it in a proc can be done with the correctly conceived statement (singular.)
    For ex – if we insert and then the select record's identity value as a single transaction and would this guarantee that what is returned by the select would not include inserts that another might have made?Please do not take that path unless you are absolutely certain that your database does not support any other way to do it.

  • Help - I cannot set the Default Java for Browsers

    Hello:
    I'm running Win 7, the Home Premium, 64 bit flavor. I have IE 8 and FF 3.5.8 installed. FF is the default browser. I've installed Java and when I go to the test page: http://www.java.com/en/download/help/testvm.xml
    I get a message which says: "Something is wrong. Java is not working."
    HOWEVER, if I open a command prompt and type java -version, I get this:
    C:\Users\dogzilla>java -version
    java version "1.6.0_17"
    Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
    Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode)
    So I went to the control panel app, the advanced tab, and expanded the node for Default Java for Browsers. I have 2 problems.
    1. The checkbox for Microsoft Internet Explorer is greyed out; I cannot change any settings here at all.
    2. I checked the checkbox for Mozilla Family. Then, when I click OK, I get an error message which states:
    "Unable to change browser settings. Please check that Mozilla or Firefox or Netscape is properly installed on the system and/or that you have sufficient permissions to change system settings."
    Since I'm writing this message to the forum using FF, I'm going to guess that I have the browser installed correctly. So that leaves me with a permissions problem -- which I don't doubt. I have no idea where to start looking though. Especially considering I can run the files in the bin directory from a command line without any problems.
    Does anyone know how I can solve the two problems I described in this thread? Suggestions are greatly appreciated.
    Thanks!

    Thanks for the reply!
    I tried running as admin and no luck. Still experiencing the same problems.
    I've did some more reading (much more in fact for what this problem should be worth) and other forums mention that on 64 bit Windows systems, both the 32 bit and 64 bit JRE need to be installed.
    When I was running Win XP, I could just download the SDK, create an environment variable, and I was good to go. Now, it looks like if I just install the SDK, I need the JRE plugin download for just the browsers -- what a ridiculous waste/duplication!
    Thanks again for your help.

  • ColdFusion 8 Fails to start after update Java for Mac OSX 10.5 Update 4

    I have been using ColdFusion on a Mac for years. Now CF fails to start after I updated Java for Mac OS X 10.5 Update 4. I usually start by typing in the terminal window sudo /Applications/ColdFusion8/bin/ColdFusion start.
    There is a crash report but I don't know how to read it. See attached.
    Please help, I need this working for my job.
    Thanks...Colin

    Dear Craig,
    Macbook Pro 2.4GHz Intel Core 2 Duo 4 GB RAM
    I'm sure that this is 64-bit
    CF 8.0.1 Enterprise Build 3080
    I had moved the Java SE 6 to the top in both Plugin and Applications. The
    correct version is showing in the terminal window. See below.
    Last login: Thu Jun 18 11:27:09 on ttys001
    Beta-4:~ Colin$ java -version
    java version "1.6.0_13"
    Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211)
    Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode)
    Beta-4:~ Colin$
    CF will not start. I have the activity monitor open, and when I start CF you
    see it in the activity monitor for a few seconds as it starts up. When the
    message process is completed in the terminal window CF disappears in the
    activity monitor.
    Any suggestions?
    C
    Hi, Colin,
    My apologies but I forgot to ask 2 questions: (1) What kind of Mac you have
    (Intel or PowerPC)? (2) What version of CF are you running and what installer
    did you choose (8 or 8.0.1, 32-bit, 64-bit, etc.)?
    To start, try the following:
    1. Normally you'd shut CF down first ... but that's not necessary for you
    2. Open Java Preferences again
    3. Select Java SE 6 and move it (drag) to the top spot in both section (Applet
    Plugin and Applications)
    4. Open Terminal
    5. Type java -version (you should see 1.6.0_13 as the new version)
    6. Try to start CF again
    This may not work (I've had issues with it) but it's technically how it's
    supposed to work. With the Java Preferences utility, you're visually setting a
    default JVM (you can do it with commands in Terminal but this is much faster
    and easier).
    If CF still won't start, look for the jvm.config file in your CF application
    folder (try /Applications/ColdFusion8/bin or
    /Applications/ColdFusion8/runtime/bin -- the latter is where a jvm.config file
    is on my machine for a particular version of CF that's installed similar to
    yours). You can override the JVM in this file but, hopefully, that won't be
    necessary!
    Best,
    Craig

  • The Java for Mac OSX 10.5 Update 10 removed the Java plugin from Firefox 5.0. How do I re-install it?

    I've just installed Java for Mac OSX 10.5 Update 10 and can no longer run Java Applets from Firefox 5.0

    Dear Craig,
    Macbook Pro 2.4GHz Intel Core 2 Duo 4 GB RAM
    I'm sure that this is 64-bit
    CF 8.0.1 Enterprise Build 3080
    I had moved the Java SE 6 to the top in both Plugin and Applications. The
    correct version is showing in the terminal window. See below.
    Last login: Thu Jun 18 11:27:09 on ttys001
    Beta-4:~ Colin$ java -version
    java version "1.6.0_13"
    Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211)
    Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode)
    Beta-4:~ Colin$
    CF will not start. I have the activity monitor open, and when I start CF you
    see it in the activity monitor for a few seconds as it starts up. When the
    message process is completed in the terminal window CF disappears in the
    activity monitor.
    Any suggestions?
    C
    Hi, Colin,
    My apologies but I forgot to ask 2 questions: (1) What kind of Mac you have
    (Intel or PowerPC)? (2) What version of CF are you running and what installer
    did you choose (8 or 8.0.1, 32-bit, 64-bit, etc.)?
    To start, try the following:
    1. Normally you'd shut CF down first ... but that's not necessary for you
    2. Open Java Preferences again
    3. Select Java SE 6 and move it (drag) to the top spot in both section (Applet
    Plugin and Applications)
    4. Open Terminal
    5. Type java -version (you should see 1.6.0_13 as the new version)
    6. Try to start CF again
    This may not work (I've had issues with it) but it's technically how it's
    supposed to work. With the Java Preferences utility, you're visually setting a
    default JVM (you can do it with commands in Terminal but this is much faster
    and easier).
    If CF still won't start, look for the jvm.config file in your CF application
    folder (try /Applications/ColdFusion8/bin or
    /Applications/ColdFusion8/runtime/bin -- the latter is where a jvm.config file
    is on my machine for a particular version of CF that's installed similar to
    yours). You can override the JVM in this file but, hopefully, that won't be
    necessary!
    Best,
    Craig

  • HT5717 Our company had to remove this Java for OS  2013-004 upgrade because it broke all of our Java installers. Does anyone know when Apple will solve this new problem?

    Hi,
    People at our company installed the latest Java for OSX 2013-004 1.0 Apple Update and all of our software installers failed to run anymore. The only way to kill the installer was Apple Menu -> Force Quit after that. We all had to downgrade to Java for OSX 2013-003 to work.

    Welcome to Apple Support Communities
    I have heard problems with that update. Unfortunately, we don't know when an update will be available. Apple often releases Java updates at the same time as Oracle, but we don't know more things

  • How Do I Get Java For Mac OSX 10.5.8 On A PowerBook G4 Or Update To Minimum MAC OSX 10.6.8 or later Without Spending Any Tech Mind Of My Own And Also Not Buy ANYTHING AT ALL!!!?????

    How Do I Get Java For Mac OSX 10.5.8 On A PowerBook G4 Or Update To Minimum MAC OSX 10.6.8 or later Without Spending Any Tech Mind Of My Own And Also Not Buy ANYTHING AT ALL!!!????? Please Help!!!

    Sorry, it's for 64 bit IntelMacs only...
    updating Java SE 6 to 1.6.0_26 for 64-bit capable Intel-based Macs. 
    Java for Mac OS X 10.5 Update 10

  • HT4884 java for 10.6.8 is not working

    my iMac says all software is up to date but websites that need java still say that i need to update to the latest version of java.

    For OS 10.6.8, I found the latest Java update didn't work right, either. I restored full functionality by reinstalling Snow Leopard from the DVD, then updating to 10.6.8, plus updating Safari, etc, BUT NOT JAVA. Java works fine as long as you don't go too far with the updates: make sure they say they're for 10.6.x .
    I think the problems begin with update 11, which seems to be tailored for OS 10.7 Lion and higher, but the installer doesn't check what OS you have before updating, nor is there any warning before you click install.
    John
    Model Identifier:
    iMac8,1
      Processor Name:
    Intel Core 2 Duo
      Processor Speed:
    2.4 GHz
    Mac OS X 10.6.8

  • How the heck do I install java for yosemite?

    I've tried following the links, but everytime I hit the download button nothing happens.  Not. A. Darned. Thing.  And I keep getting the message that I need to install Java for things to run properly. 

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen. Click the Clear Display icon in the toolbar. Then take one of the actions that you're having trouble with. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • User defined function in java for message mapping

    I wrote the following user defined function in java for message mapping and mapped vendor with this. The aim of this function is to write a error file at defined path when i send empty Vendor value from File to RFC-Function module BAPI_PO_CREATE. The "err.txt" error file is not written when i execute in TEST but the value "ERROR" is returned to destination Vendor Field.
    public String  validation(String a, Container container) {
    //write your code here
    if (a.equals("")) {
    try {
    String source = "Vendor cannot be empty";
    char buffer[] = new char[source.length()];
    source.getChars(0, source.length(), buffer, 0);
    for (int i = 0; i < buffer.length; i +=2)
       f0.write(buffer<i>);
    f0.close();
    FileWriter f1 =  new FileWriter("/10.10.0.55/sapmnt/trans/edixiin/err.txt");
    f1.write(buffer);
    f1.close();
    catch (IOException e) {}
    return "ERROR";

    Hi Senthil,
    Check these things :
    1) Whether you have permission to create a file in that directory.
    2) try giving this 
    10.10.0.55
    sapmnt
    trans
    edixiin
    err.txt
    3) Also check for permissions.
    Hope this will help you.
    Regards
    Suraj

  • Java broken in Firefox after Java for Mac OS X 10.6 Update 3

    After having updated my mac this morning with the latest Java for Mac OS X 10.6 Update 3, Java in Firefox is no longer working. When I open a site that contains a java applet (like javatester.org) I get the following output in the Console, and then Firefox hangs.
    21.10.10 11:44:15 [0x0-0x33033].org.mozilla.firefox[649] ### MRJPlugin: getPluginBundle() here. ###
    21.10.10 11:44:15 [0x0-0x33033].org.mozilla.firefox[649] ### MRJPlugin: CFBundleGetBundleWithIdentifier() succeeded. ###
    21.10.10 11:44:15 [0x0-0x33033].org.mozilla.firefox[649] ### MRJPlugin: CFURLGetFSRef() succeeded. ###
    Any ideas??

    Problem solved!
    For some reason I had an additional "Java" Folder (/Library/Java) with a different Java sdk. After removing this folder and (just to be sure) replacing it with a symlink to /System/Library/Java everyting works again.

Maybe you are looking for

  • I can not print only a selected part of a page

    I have reset the print.print_printer and still can't print only the selected part of a page. I highlight what I want to print and use control P to get to the printer setup. Then I click the selection button and then OK. The preview screen shows what

  • Cannot apply OS image to lenovo with usb Ethernet

    Greetings,   We have a Windows 8.1 task sequence which works fine on over a dozen laptops that have an ethernet adapter. We recently acquired a Lenovo Helix machine that doesnt have an inbuilt adapter but has a usb ethernet adapter. I found the drive

  • Convert from String data type to Character data type

    Hi..., I'm a beginner. I try to make a program. But I don't know how to convert from string to data type. I try to make a calculator with GUI window. And when somebody put "+" to one of the window, I just want to convert it to Character instead of St

  • IMac not remembering username and password

    Hi, I recently bought a Qwest wireless DSL modem and set it up with my iMac. I chose my username and password for my network. I also set my security to have the network invisible. It worked great for weeks, but the last several days when I would shut

  • Compiling and running a package

    Hi Iduring making a project i am facing a problem. I have two files under the directory c:\jdk1.3\ghosh\das, named as ghosh.java and das.java they are like the folloing: ghosh.java package.java.das; import java.io.*; import.java.util.*; public class