Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 1.1 KB

README.md

File metadata and controls

25 lines (19 loc) · 1.1 KB

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.

Include NetLogo source files

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.

Run NetLogo model in the headless mode from Java

Check the Java source code here and follow the two steps.

  1. Replace the path directory/*.jar with your own path of NetLogo in file compile.sh and MANIFEST.MF.
  2. Compile and run.
bash compile.sh
bash run.sh

Call NetLogo from Python

cd python
python test.py

Reference

Usage of __includes

NetLogo Controlling API