Skip to content
Snippets Groups Projects
Commit 38b863c0 authored by Martin Lange's avatar Martin Lange
Browse files

Merge branch 'setup-netlogo-project' into 'main'

Setup for a minimal NetLogo model

See merge request !2
parents 3211389e 2854893c
No related branches found
No related tags found
1 merge request!2Setup for a minimal NetLogo model
Pipeline #15924 passed with stage
in 13 seconds
/model/
/odd/
...@@ -2,4 +2,49 @@ ...@@ -2,4 +2,49 @@
This is an example project to demonstrate Literate Programming to create [NetLogo](https://ccl.northwestern.edu/netlogo/) models from ODD+C protocols. This is an example project to demonstrate Literate Programming to create [NetLogo](https://ccl.northwestern.edu/netlogo/) models from ODD+C protocols.
## Rabies model - ODD protocol
### Purpose
### Entities, state variables, and scales
### Process overview and scheduling
```netlogo
;- file:Code.nls
; ==> Setup.
; ==> Go.
```
```netlogo
;- Go
to go
tick
end
```
### Design concepts
### Initialization
```netlogo
;- 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.
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
fence_sequence = "```" fence_sequence = "```"
fence_sequence_alt = "~~~" fence_sequence_alt = "~~~"
block_name_prefix = "//-" block_name_prefix = ";-"
macro_start = "// ==>" macro_start = "; ==>"
macro_end = "." macro_end = "."
transclusion_start = "@{{" transclusion_start = "@{{"
...@@ -15,29 +15,25 @@ link_prefix = "@" ...@@ -15,29 +15,25 @@ link_prefix = "@"
file_prefix = "file:" file_prefix = "file:"
hidden_prefix = "hidden:" hidden_prefix = "hidden:"
# default_language = "rust"
[paths] [paths]
root = "lp/" root = "."
code = "../model/" code = "model/"
docs = "../odd/" docs = "odd/"
files = ["ODD.md"] files = ["README.md"]
# entrypoint = "Main" entrypoint = "Main" # Avoids writing unnamed code blocks
# code_files = ["**/*.rs"] # NetLogo is not suited to generate the UI from code.
# code_paths = ["_"] # We therefore use the copy files feature for the base .nlogo file, and for UI.
code_files = ["nlogo/Model.nlogo"]
# doc_files = ["**/*.png", "**/*.jpg"] code_paths = ["-"]
# doc_paths = ["_"]
[language.nls]
# [language.rs] clear_blank_lines = true
# clear_blank_lines = true eof_newline = true
# eof_newline = true
[language.nls.block_labels]
# [language.rs.block_labels] comment_start = ";"
# comment_start = "//" block_start = "<@"
## comment_end = "*/" block_next = "<@>"
# block_start = "<@" block_end = "@>"
# block_next = "<@>"
# block_end = "@>"
# Rabies model - ODD protocol
__includes["Code.nls"]
@#$#@#$#@
GRAPHICS-WINDOW
220
10
733
524
-1
-1
5.0
1
10
1
1
1
0
1
1
1
0
100
0
100
1
1
1
ticks
30.0
BUTTON
10
10
80
50
NIL
setup
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
90
10
160
50
NIL
go
T
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
@#$#@#$#@
## WHAT IS IT?
## HOW IT WORKS
## HOW TO USE IT
@#$#@#$#@
default
true
0
Polygon -7500403 true true 150 5 40 250 150 205 260 250
@#$#@#$#@
NetLogo 6.1.0
@#$#@#$#@
@#$#@#$#@
@#$#@#$#@
@#$#@#$#@
@#$#@#$#@
default
0.0
-0.2 0 0.0 1.0
0.0 1 1.0 0.0
0.2 0 0.0 1.0
link direction
true
0
Line -7500403 true 150 150 90 180
Line -7500403 true 150 150 210 180
@#$#@#$#@
0
@#$#@#$#@
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment