@@ -4,6 +4,33 @@ This is an example project to demonstrate Literate Programming to create [NetLog
The document you are currently reading contains the [ODD protocol](#rabies-model-odd-protocol)([Grimm et al. 2006, 2010](#references)) of a model for Rabies in red foxes. The ODD description is interleaved with code blocks showing the NetLogo code used for the described aspect (ODD+C). Using the Literate Programming tool [Yarner](https://github.com/mlange-42/yarner), these code blocks are extracted from the document and arranged into a working NetLogo model.
*[How to use it](#how-to-use-it)
*[How it works](#how-it-works)
*[Rabies model - ODD protocol](#rabies-model-odd-protocol)
*[References](#references)
*[Appendix](#appendix)
## How to use it
**Read the ODD**
The best way to understand how to use Literate Programming with Yarner to create a NetLogo model from an ODD protocol is to read the below [ODD+C of the Rabies model.](#rabies-model-odd-protocol) It contains the complete code of the model, except the UI elements.
See section [How it works](#how-it-works) for how the model is extracted from this document.
**Run from downloads**
The [Downloads](https://git.ufz.de/oesa/literate-netlogo/-/jobs/artifacts/main/download?job=build) contain a folder `model` with files `Model.nlogo` and `Code.nls`. Open the `.nlogo` file with NetLogo.
Yarner scans the document for code blocks and puts them together using macros. Each code block has a name, given in its first line and prefixed with `;-`:
...
...
@@ -30,27 +57,16 @@ let y 1
For a comprehensive guide and a description of all features, see the [Yarner documentation](https://mlange-42.github.io/yarner/).
## How to use it
**Read the ODD**
The best way to understand how to use Literate Programming with Yarner to create a NetLogo model from an ODD protocol is to read the below [ODD+C of the Rabies model.](#rabies-model-odd-protocol) It contains the complete code of the model, except the UI elements.
**Run from downloads**
The [Downloads](https://git.ufz.de/oesa/literate-netlogo/-/jobs/artifacts/main/download?job=build) contain a folder `model` with files `Model.nlogo` and `Code.nls`. Open the `.nlogo` file with NetLogo.