Skip to content

Sample code for including NetLogo source files and running NetLogo models in the headless mode.

Notifications You must be signed in to change notification settings

hilbert9221/NetLogoSampleCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Sample code for including NetLogo source files and running NetLogo models in the headless mode.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published