Table of Contents
Headless mode
GroIMP can be started without its graphical interface, in a non interactive headless mode. This mode can either execute a specified model and or a specified GroIMP command and can therefore be used for simple automation or as a base for e.g. the HTTP server.
If a model is started in headless, GroIMP executes it,logs the console output and afterwards shut down. Capturing any feedback from the simulation must be included in the model.
Running a model headless
To execute a given model in headless the additional parameter –headless is used:
java -Xverify:none -jar core.jar --headless /path/to/your/model.gsz
This will return a list of all installed plugins including versions and then start the model. Any further actions must be defined in the code of the Model, including the steps of the simulation, the way data is printed/exported and the closing of the workbench at the end.
For the automated starting of the simulation overwriting the startup function of the simulation is recommended.
Executing a command headless
GroIMP is capable of executing any registry command on startup, if this command is provided as full path using the additional command line argument: '-- -cmd "/path/to/command" '. This is mostly used to start the HTTP server but also combining this with a provided model is possible as shown here.