Simple smittespredningsmodel

Simple smittespredningsmodel preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.2 • Viewed 125 times • Downloaded 15 times • Run 0 times
Download the 'Simple smittespredningsmodel' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


## Hvad er dette?

Denne model er en forsimplet udgave af “virus” copyright Uri Wilensky, 1998 Modellen er lavet i forbindelse med DASG projektet “computational thinking”, 2018-2019 af Eva Danielsen, Nærum Gymnasium

Pakken indeholder foreløbig tre programmer: Dillen_breder_sig_2d, Rektors_problem_2d og rektors_problem_gåhjem_2d.

## Historien

I denne model optræder elever og lærere på et gymnasium. Hver person kan enten være "rask", "inficeret", eller immun. I starten af modellen er alle raske, undtagen én, som er inficeret. Hvor smitsom sygdommen er kan reguleres, men afhænger i virkeligheden af sygdommens natur, elevernes hygiejne, og generel adfærd.

I rektors_problem_gåhjem_2d kan eleverne desuden sættes til at gå hjem. Dette gøres ved at de går mod centrum ved at gange deres koordinatsæt med et tal 0

Modellen får eleverne til at smitte mindre, dels ved at de flytter i karentæne, men også på vejen ind spreder de sig mindre, da de smittede følges ad, og derfor ikke dækker så stort et område.

## Den matematiske model.

Modellen er simulerer epidemimodellen, SIR, hvor der optræder modtagelige (suscetible) og inficerede (infected) og recovered.

SIR-modellen er et godt eksempel på koblede differentialligninger der ikke kan løses analytisk, men kan løses numerisk med Eulers metode eller andre numeriske metoder.

## WHAT IS IT?

(a general understanding of what the model is trying to show or explain)

## HOW IT WORKS

(what rules the agents use to create the overall behavior of the model)

## HOW TO USE IT

(how to use the model, including a description of each of the items in the Interface tab)

## THINGS TO NOTICE

(suggested things for the user to notice while running the model)

## THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

## EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

## NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

## RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

## CREDITS AND REFERENCES

(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

turtles-own
[ sick?                 ;; if true, the turtle is infectious
  immune?               ;; if true, the turtle is immune
  sick-time   ]          ;; how long, in days the turtle has been infectious

globals
  [ %infected            ;; what % of the population is infectious
    %immune ]             ;; what % of the population is immune

;; The setup is run when clicking "setup" in the interface

to setup
  clear-all
  setup-turtles
  update-global-variables
  update-display
  reset-ticks
end 

;; We create a variable number of turtles of which 1 is infectious, and distribute them randomly

to setup-turtles
  create-turtles 1000
    [ setxy random-xcor random-ycor
      set size 2
      set shape "dot"               ;;  Her sættes formen til at være en prik. Prøv at ændre til "person".
      get-healthy
      set immune? false ]
  ask n-of 1 turtles
    [ get-sick ]
end 

;; The go is run when clicking "go" in the interface

to go
  ask turtles [
    move
    if sick?
    [ get-older
      recover
      infect
     ;survive             ;; Fjern semikolonet foran survive i starten af denne linje og se hvad der sker.
    ]
  ]
  update-global-variables
  update-display
  tick
end 

to survive
  if random 1000 < 10 [ die ]
end 

to get-sick
  set sick? true
end 

to get-healthy
  set sick? false
  set sick-time 0
end 

to move
  right random 100 - 50    ; Drej en tilfældig vinkel mellem -50 og 50
  forward 1                ; Gå en frem
end 

;; If a turtle is sick, it infects other turtles on the same patch.
;; Immune turtles don't get sick.

to infect
  ask other turtles-here with [ not sick? and not immune?]
    [ if random-float 100 < infectiousness
      [ get-sick ] ]
end 

to recover ;; Hvis personen har været syg længe nok, bliver personen rask og immun
  if sick-time > duration
  [become-immune]
end 

to become-immune
  set sick? false
  set sick-time 0
  set immune? true
end 

to get-older
  set sick-time sick-time + 1
end 

to update-global-variables
  if count turtles > 0
    [ set %infected (count turtles with [ sick? ] / count turtles) * 100
      set %immune (count turtles with [immune?] / count turtles) * 100
       ]
end 

to update-display
  ask turtles
    [
      set color ifelse-value sick? [ red ]  [ifelse-value immune? [grey] [ green ] ]
  ]
end 

; Smittespredning  modificeret ud fra "virus", copyright 1998, Uri Wilensky.
; See Info tab for full copyright and license.

There are 3 versions of this model.

Uploaded by When Description Download
Solveig Skadhauge over 2 years ago fit to window Download this version
Solveig Skadhauge over 2 years ago fit to windows Download this version
Solveig Skadhauge over 2 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Simple smittespredningsmodel.png preview Preview for 'Simple smittespredningsmodel' over 2 years ago, by Solveig Skadhauge Download

This model does not have any ancestors.

This model does not have any descendants.