This repository provides a showcase for including NetLogo source files (.nls
), running NetLogo model in a headless mode and calling NetLogo from Python. The code was tested wih NetLogo 6.2.1. For other versions of NetLogo, re-editing the .nlogo
file and re-setting the path for NetLogo should work.
Simple codes for printing "Hello World!" are provided at the directory netlogo
. Simply run netlogo/model.nlogo
and netlogo/split_model.nlogo
separately to check if they work the same.
Check the Java source code here and follow the two steps.
- Replace the path
directory/*.jar
with your own path of NetLogo in file compile.sh and MANIFEST.MF. - Compile and run.
bash compile.sh
bash run.sh
cd python
python test.py