Search code examples
javaanylogic

How to close an anylogic experiement automatically


I'm working on creating a batch simulation process for which I'd like to run a simulation and once it is complete, have it close itself. I see there are functions for pausing, finishing, and stopping a simulation run, but haven't found one to close the entire program execution. Does that exist, and if so, what is it?


Solution

  • The highest level of control in anylogic is called an experiment. To close that use close(). This will immediately stop the experiment, destroy it and close the windows. Source

    Experiments may have multiple runs of a simulation. To stop a simulation you can use getEngine().finish() to soft stop it, and getEngine().stop() to hard stop it. Source