Exporting a model as Standalone Java Application

You can export your models as standalone Java applications and deploy them on other machines, including servers. Java applications are not subject to security restrictions and can communicate with databases, external files and other applications. This feature enables you to embed simulation models into larger decision support systems.

 To export a model as Java application

  1. Select any item of the model in the Projects view and choose Export >To Stand-alone Java Application from the main menu, or
    Right-click (Mac OS: Ctrl+click) the model in the Projects view (the top-level item of the model tree) and choose Export >To Stand-alone Java Application from the popup menu.
  2. This opens the Export Model dialog box. 

  1. Select the experiment, which settings you want to be applied to the model, from the Experiment to Export drop-down list.
  2. Specify a folder, where you want files of exported model to be stored, in the Destination folder box. You can browse for the destination folder using the Browse button.
  3. If you want to browse to the exported model folder on export completion, leave the check box Browse exported model folder selected.
  4. By default, toolbar buttons and other UI elements of your standalone application will be named according to the locale settings of your computer. If you, however, plan to share your application with customers from other countries, choose other language from the Language drop-down list).
  5. Click Finish. You will see a message box informing you that the model was successfully exported.
The model exported as Java application consists of the following files:
Simulation Application (AnyLogic model exported as standalone Java application) does not require AnyLogic installed on the computer and can be run on any Java-enabled machine.

 To run Simulation Application (AnyLogic model exported as standalone Java application)

  1. Launch the <model name>.bat/.cmd/.sh file generated for the exported model. The file might be located in the folder you have specified whlie exporting the model.

Having run the application, you will see the application window similar to the presentation window shown on model launch from AnyLogic IDE.

The window of the model exported as standalone application

The model application window

The window of the model exported as standalone application displays the presentation of the model and as well as the presentation window has the toolbar and the statusbar. Both toolbar and statusbar are quite similar to the ones of the presentation window, so here we just give the references to the help documents describing the analogous components of the presentation window:

The size of the window is defined in the properties of the exported model, in AnyLogic IDE.

But since in this case we deal not with the model launched from AnyLogic IDE, but with the standalone application, the toolbar has two more items: Preferences... and About AnyLogic Engine Runtime that enable the user to configure the application preferences and to get information on the program correspondingly.

Preferences

 To open the application preferences

  1. Click the Customize toolbar  toolbar button and choose Preferences... from the popup menu.

  1. You will see the AnyLogic Engine Runtime Preferences dialog box:

AnyLogic Engine Runtime Preferences dialog box

Regional Settings

Language - By default the application UI will be in the language that was selected on model export. Here you can change it to any other language from the set of languages supported by AnyLogic: English, Russian, German, Chinese, or Portuguese (Brasil)

3D Window Settings

Navigation-Rotation mode key - Sets the key (Alt, Ctrl, or Shift) that is used for rotating 3D animation scene. (To rotate the scene, press this key and move the mouse with the left button pressed).

Enable AnyLogic light & grid shaders - If selected, the model will use light and grid shaders, providing nice lighting effects. Please note that shaders may be not supported by some X3D files and/or hardware.

Performance Settings

Number of processors for parallel execution - AnyLogic supports multicore processors. When you start optimization or parameter variation experiment, AnyLogic Engine Runtime may run several iterations in parallel on different processor cores. Thereby performance is multiply increased and the experiment is performed significantly quicker than on processor with a single core. In case your machine has multicore processor, here you can set the number of processors that you want to be used for parallel execution of model runs.

Program information

The model exported as standalone Java application is executed by runtime version of the AnyLogic simulation engine - AnyLogic Engine Runtime.

With the help of the About program dialog box you can know the version of the AnyLogic Engine Runtime used by the model as well as the Java version and architecture (32- or 64-bit) and also get access to the license agreement.

 To open the About program dialog box

  1. Click the Customize toolbar  toolbar button and choose About AnyLogic Engine Runtime from the popup menu:

  1. You will see the About AnyLogic Engine Runtime dialog box shown.

About AnyLogic Engine Runtime dialog box