Skip to content
Snippets Groups Projects

Literate NetLogo

This is an example project to demonstrate Literate Programming to create NetLogo models from ODD+C protocols.

Rabies model - ODD protocol

Purpose

Entities, state variables, and scales

Process overview and scheduling

;- file:Code.nls
; ==> Setup.
; ==> Go.
;- Go
to go
  tick
end

Design concepts

Initialization

;- Setup
to setup
  reset-ticks
end

Input data

Submodels

Appendix

NetLogo file

In the main nlogo file, we only "include" an nls file to allow for the reverse mode. The file Model.nlogo is simply copied from the nlogo directory via option code_files in the [paths] section of the Yarner.toml.

This separation of model code and user interface also allows to edit the model's UI elements in NetLogo's GUI builder tool, while using Literate Programming for the code.