Find more information on the Headless implementation and functions here.
You can find an example here.
Download the example project and run in with java -Xverify:none -jar core.jar –headless PATH/TO/THE/MODEL.gsz
.
The model will run in background, grow few steps of the plant model, and export several views for each step.
You can create the default RGG model from the GroIMP file> new> new RGG project
.
You then need to add some methods in the model that will be called by GroIMP.
The startup()
method is called when the project is open. We use it to call the runLater(Object)
methods where the actual code is going to be processed.
protected void startup() { super.startup(); if (de.grogra.pf.boot.Main.getProperty("headless") != null) { runLater(null); } } protected void run(Object info) { // Stuff to do... System.exit(0); }
Save the model, then run it with the command: java -jar core.jar –headless PATH/TO/THE/MODEL.gsz
.