sir_02

sir_02 preview image

1 collaborator

Martin_rost Martin Rost (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.1 • Viewed 92 times • Downloaded 4 times • Run 0 times
Download the 'sir_02' modelDownload this modelEmbed this model

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


Comments and Questions

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

Click to Run Model

breed [suszeptible suszeptibles]
breed [kranke krankes]
breed [geheilte geheiltes]
breed [tote totes]

patches-own [viren]
kranke-own [dauer]

to setup
  clear-all
  setup-patches
  setup-suszeptible
  setup-kranke
  reset-ticks
end 

to setup-patches
  ask patches [
    set pcolor 0
    set viren 0
  ]
end 

to setup-suszeptible
  create-suszeptible Individuen
  ask suszeptible [
    setxy random-xcor random-ycor
    set color 55
    set shape "circle"
  ]
end 

to setup-kranke
  create-kranke 10
  ask kranke [
    setxy random-xcor random-ycor
    set color 15
    set shape "circle"
    set dauer 14
  ]
end 

to go
  if ticks >= 360 [ stop ] ;; nach einem Jahr aufhören
  move-suszeptible
  move-kranke
  move-geheilte
  infiziere-umgebung
  klinge-ab
  stecke-dich-an
  werde-gesund-oder-stirb
  tick                     ;; Tage mitzählen
end 

to move-suszeptible
  ask suszeptible [
    right random 360
    forward Beweglichkeit
  ]
end 

to move-kranke
  ask kranke [
    right random 360
    forward Beweglichkeit
    set dauer dauer - 1
  ]
end 

to move-geheilte
  ask geheilte [
    right random 360
    forward Beweglichkeit
  ]
end 

to infiziere-umgebung
  ask kranke [
    set viren verseuchung
    ]
end 

to klinge-ab
  ask patches [
    if viren > 0 [
      set viren viren - 1
    ]
  ]
end 

to stecke-dich-an
  ask suszeptible[
    if random verseuchung < viren [
      hatch-kranke 1 [
        set color 15
        set shape "circle"
        set dauer 14]
      die
    ]
  ]
end 

to werde-gesund-oder-stirb
  ask kranke[
    if dauer < 1 [
      ifelse random 100 < sterblichkeit
      [ hatch-tote 1 [
        set color 5
        set shape "circle"
        ]
      ]
      [
        hatch-geheilte 1 [
          set color 95
          set shape "circle"
        ]
      ]
      die
    ]
  ]
end 
;; to check-death
;;  ask turtles [
;;    if energy <= 0 [ die ] ;; removes the turtle if it has no energy left
;;  ]
;; end

;; to regrow-grass
;;   ask patches [ ;; 3 out of 100 times, the patch color is set to green
;;     if random 100 < 3 [ set pcolor green ]
;;    ]
;; end


; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.

There is only one version of this model, created almost 4 years ago by Martin Rost.

Attached files

File Type Description Last updated
sir_02.png preview Preview for 'sir_02' almost 4 years ago, by Martin Rost Download

This model does not have any ancestors.

This model does not have any descendants.