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
136b289e
Commit
136b289e
authored
4 years ago
by
Martin Lange
Browse files
Options
Downloads
Patches
Plain Diff
added disease course and slider ticks-infected
parent
4e8c2b29
No related branches found
Branches containing commit
No related tags found
1 merge request
!3
Building the Rabies model from ODD
Pipeline
#15928
passed with stage
in 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+27
-2
27 additions, 2 deletions
README.md
nlogo/Model.nlogo
+15
-0
15 additions, 0 deletions
nlogo/Model.nlogo
with
42 additions
and
2 deletions
README.md
+
27
−
2
View file @
136b289e
...
...
@@ -15,6 +15,7 @@ Each patch has a disease state.
patches-own [
state
infected-neighbours
ticks-to-death
]
```
...
...
@@ -43,11 +44,13 @@ set R 3
;- Go
to go
infect-patches
age-infection
update-patches
tick
end
; ==> Infection.
; ==> Disease course.
; ==> Update patches.
```
...
...
@@ -65,7 +68,7 @@ to setup
set state S
]
ask one-of patches [
set state I
infect-patch
]
update-patches
...
...
@@ -92,12 +95,13 @@ to infect-patches
]
ask patches with [ state = S ] [
if random-float 1 < calc-infection-prob [
set state I
infect-patch
]
]
end
; ==> Infection probability.
; ==> Infect patch.
```
```
netlogo
...
...
@@ -107,6 +111,27 @@ to-report calc-infection-prob
end
```
```
netlogo
;- Infect patch
to infect-patch
set state I
set ticks-to-death ticks-infected
end
```
#### Disease course
```
netlogo
;- Disease course
to age-infection
ask patches with [ state = I ] [
if ticks-to-death = 0 [
set state EMPTY
]
set ticks-to-death ticks-to-death - 1
]
end
```
#### Visualization
...
...
This diff is collapsed.
Click to expand it.
nlogo/Model.nlogo
+
15
−
0
View file @
136b289e
...
...
@@ -76,6 +76,21 @@ beta
NIL
HORIZONTAL
SLIDER
10
100
215
133
ticks-infected
ticks-infected
1
10
2.0
1
1
NIL
HORIZONTAL
@#$#@#$#@
## WHAT IS IT?
...
...
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