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
73ef8109
Commit
73ef8109
authored
4 years ago
by
Martin Lange
Browse files
Options
Downloads
Patches
Plain Diff
complated basic model by adding dispersal
parent
136b289e
No related branches found
Branches containing commit
No related tags found
1 merge request
!3
Building the Rabies model from ODD
Pipeline
#15929
passed with stage
Stage: test
in 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+47
-3
47 additions, 3 deletions
README.md
nlogo/Model.nlogo
+62
-2
62 additions, 2 deletions
nlogo/Model.nlogo
with
109 additions
and
5 deletions
README.md
+
47
−
3
View file @
73ef8109
...
@@ -16,6 +16,7 @@ patches-own [
...
@@ -16,6 +16,7 @@ patches-own [
state
state
infected-neighbours
infected-neighbours
ticks-to-death
ticks-to-death
dispersal-tick
]
]
```
```
...
@@ -43,15 +44,18 @@ set R 3
...
@@ -43,15 +44,18 @@ set R 3
```
netlogo
```
netlogo
;- Go
;- Go
to go
to go
if ticks mod 12 = 0 [
assign-dispersal
]
disperse
infect-patches
infect-patches
age-infection
age-infection
update-patches
update-patches
tick
tick
end
end
; ==> Infection.
; ==> Submodels.
; ==> Disease course.
; ==> Update patches.
```
```
### Design concepts
### Design concepts
...
@@ -80,6 +84,46 @@ end
...
@@ -80,6 +84,46 @@ end
### Submodels
### Submodels
```
netlogo
;- Submodels
; ==> Dispersal.
; ==> Infection.
; ==> Disease course.
; ==> Update patches.
```
#### Dispersal
```
netlogo
;- Dispersal
to assign-dispersal
ask patches with [ state != EMPTY ] [
set dispersal-tick (ticks + start-dispersal + random length-dispersal)
]
end
```
```
netlogo
;- Dispersal
to disperse
ask patches with [ state != EMPTY and dispersal-tick = ticks ] [
let candidates other patches
in-radius dispersal-radius
with [ state = EMPTY ]
let num-candidates num-offspring
if count candidates < num-candidates [
set num-candidates count candidates
]
ask n-of num-candidates candidates [
set state S ; no dispersal of infected
; alternative:
; set state [state] of myself
; set ticks-to-death [ticks-to-death] of myself
]
]
end
```
#### Infection
#### Infection
```
netlogo
```
netlogo
...
...
This diff is collapsed.
Click to expand it.
nlogo/Model.nlogo
+
62
−
2
View file @
73ef8109
...
@@ -78,9 +78,9 @@ HORIZONTAL
...
@@ -78,9 +78,9 @@ HORIZONTAL
SLIDER
SLIDER
10
10
100
95
215
215
1
33
1
28
ticks-infected
ticks-infected
ticks-infected
ticks-infected
1
1
...
@@ -91,6 +91,66 @@ ticks-infected
...
@@ -91,6 +91,66 @@ ticks-infected
NIL
NIL
HORIZONTAL
HORIZONTAL
SLIDER
10
155
215
188
start-dispersal
start-dispersal
0
11
8.0
1
1
NIL
HORIZONTAL
SLIDER
10
190
215
223
length-dispersal
length-dispersal
1
11
3.0
1
1
NIL
HORIZONTAL
SLIDER
10
250
215
283
dispersal-radius
dispersal-radius
1
5
3.0
0.5
1
NIL
HORIZONTAL
SLIDER
10
285
215
318
num-offspring
num-offspring
0
10
4.0
1
1
NIL
HORIZONTAL
@#$#@#$#@
@#$#@#$#@
## WHAT IS IT?
## 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