Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Literate NetLogo
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OESA
Literate NetLogo
Commits
31642fc0
Commit
31642fc0
authored
4 years ago
by
Martin Lange
Browse files
Options
Downloads
Patches
Plain Diff
setup basic no-op model with globals
parent
38b863c0
No related branches found
Branches containing commit
No related tags found
1 merge request
!3
Building the Rabies model from ODD
Pipeline
#15926
passed with stage
Stage: test
in 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+59
-6
59 additions, 6 deletions
README.md
with
59 additions
and
6 deletions
README.md
+
59
−
6
View file @
31642fc0
# Literate NetLogo
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
Each patch has a disease state.
### Entities, state variables, and scales
```
netlogo
;- State variables
patches-own [
state
]
```
### Process overview and scheduling
```
netlogo
;- Disease states
globals [
EMPTY
S
I
R
]
```
```
netlogo
;- file:Code.nls
; ==> Setup.
; ==> Go.
;- Setup disease states
set EMPTY 0
set S 1
set I 2
set R 3
```
### Process overview and scheduling
```
netlogo
;- Go
to go
update-patches
tick
end
; ==> Update patches.
```
### Design concepts
...
...
@@ -32,6 +55,9 @@ end
```
netlogo
;- Setup
to setup
clear-all
; ==> Setup disease states.
update-patches
reset-ticks
end
```
...
...
@@ -40,8 +66,35 @@ end
### Submodels
#### Visualization
```
netlogo
;- Update patches
to update-patches
ask patches [
ifelse state = EMPTY [ set pcolor white ]
[ ifelse state = S [ set pcolor blue ]
[ ifelse state = I [ set pcolor red ]
[ set pcolor green ] ] ]
]
end
```
## Appendix
### Code
```
netlogo
;- file:Code.nls
; ==> Disease states.
; ==> State variables.
; ==> Setup.
; ==> Go.
```
### NetLogo file
In the main
`nlogo`
file, we only "include" an
`nls`
file to allow for the reverse mode.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment