NetLogo: Difference between revisions
Jump to navigation
Jump to search
| Line 15: | Line 15: | ||
* Put your <tt>.nlogo</tt> file and any accompanying files in the same directory | * Put your <tt>.nlogo</tt> file and any accompanying files in the same directory | ||
* Invoke the <tt>run</tt> shell script: <tt>./run</tt> | * Invoke the <tt>run</tt> shell script: <tt>./run</tt> | ||
* | ** The script should now provide usage instructions. If you get an error, please consult a senior modeler in the group. | ||
** The syntax for running an experiment is: <tt>./run MODEL EXPERIMENT</tt>. If we want to run the <tt>Exp1</tt> experiment for the <tt>MyModel</tt> model, the command is: <tt>./run MyModel.nlogo Exp1</tt> | |||
* The results will be saved in the NetLogo table format to a file named <tt>MODEL_EXPERIMENT_output.csv</tt>. As per the example above, the output file becomes <tt>MyModel_Exp1_output.csv</tt> | |||
Revision as of 13:05, 10 January 2017
Common problems with NetLogo
Running NetLogo headless
NetLogo can be run in what is called "headless mode", which means that it runs simulations without showing a graphical user interface (GUI). This speeds up computation quite a bit, but has the drawback that there is no user feedback during the simulation run.
To run NetLogo headless, one needs to invoke it from the command line. The commands for this are explained in the NetLogo documentation.
In order to make this process a little bit easier, the SESLINK group has a ready-made package for running NetLogo headless. It's designed for UNIX systems (Linux and MacOS X) and runs in the command line.
Step-by-step guide:
- Download the package from here.
- Put it in the desired location
- Unzip it using the unzip command: unzip netlogo-headless.zip
- Put your .nlogo file and any accompanying files in the same directory
- Invoke the run shell script: ./run
- The script should now provide usage instructions. If you get an error, please consult a senior modeler in the group.
- The syntax for running an experiment is: ./run MODEL EXPERIMENT. If we want to run the Exp1 experiment for the MyModel model, the command is: ./run MyModel.nlogo Exp1
- The results will be saved in the NetLogo table format to a file named MODEL_EXPERIMENT_output.csv. As per the example above, the output file becomes MyModel_Exp1_output.csv