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

added disease course and slider ticks-infected

parent 4e8c2b29
No related branches found
No related tags found
1 merge request!3Building the Rabies model from ODD
Pipeline #15928 passed with stage
in 13 seconds
......@@ -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
......
......@@ -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?
......
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