Dengue Netlogo Model

My group worked on code that models dengue fever in a specific area. However, we do not understand what is wrong with the code, since the infected one is not infected. Sorry, we are new to this programming. Hope you can spend time and watch the program. Thanks.

breed [humans human]
breed [mosquitoes mosquito]
breed [dead]

globals [
  total-human     ;; Total number of agents that are human
  total-mosquito  ;; Total number of mosquitoes that are human
  angle           ;; Heading for individuals
]

turtles-own [
  kill                  ;; Agent-subset consisting of mosquitoes within          vison of human
  infected-human?       ;; If true, human is infected
  infected-mosquito?    ;; If true, mosquito is infected
  susceptible-human?    ;; If true, human is susceptible
  susceptible-mosquito? ;; If true, mosquito is susceptible
]

to setup
clear-all
setup-people
setup-mosquitoes
create-dead 0
[ set shape "square"
  set color orange ]
reset-ticks
end

to setup-people
create-humans initial-people
[
  setxy random-xcor random-ycor
  set shape "person"
 set color white

  set infected-human? false
  set susceptible-human? true

  if who < initial-infected-people ;; these people are initially infected
  [
    set infected-human? true
    set susceptible-human? false
  ]

  assign-color-human
]
end

to setup-mosquitoes
create-mosquitoes initial-mosquito
[
  setxy random-xcor random-ycor
  set shape "mosquito"
  set color blue

  set infected-mosquito? false
  set susceptible-mosquito? true

  if (random-float 100 < 10) ;; 10% of mosquitoes are initially infected
  [
    set infected-mosquito? true
    set susceptible-mosquito? false
  ]
  assign-color-mosquito
 ]
end

to assign-color-human
  if infected-human? [ set color red ]
  if susceptible-human? [ set color white ]
end

to assign-color-mosquito
  if infected-mosquito? [ set color yellow ]
  if susceptible-mosquito? [set color blue ]
end

to go
   move-mosquitoes
   move-people
    end

to move-mosquitoes
  ask mosquitoes
  [
rt random 100
lt random 100
fd 1
  ]
  tick

end

to move-people
  ask humans
  [
rt random 100 ;people move around the world randomly
lt random 100
fd 1

ifelse infected-human? = true ;there is a chance that if people are       infectious they will infect mosquitoes who bite them
  [ask mosquitoes in-radius bite-likelihood
    [if any? mosquitoes with [susceptible-mosquito? = true]
                  [set infected-mosquito? true
                   set susceptible-mosquito? false]
    ]
  ]

  [ask mosquitoes in-radius bite-likelihood ;there is a chance that if people are not infectious they can be infected by infectious mosquitoes
    [ifelse infected-mosquito? = true ;if mosquitoes are infectious they can infect nearby non-infected people
                  [ask humans in-radius bite-likelihood [if any? humans in-radius bite-likelihood with [susceptible-human? = true]
                                                                          [set infected-human? true
                                                                           set susceptible-human? false]
                                                               ]
                  ]
                  [ask humans in-radius bite-likelihood with [susceptible-human? = true] [if any? humans in-radius bite-likelihood with [susceptible-human? = true]
                                                                          [set infected-human? false
                                                                           set susceptible-human? true]] ;if noninfectious mosquitoes bite noninfectious people, nothing happens

                  ]
    ]
  ]

  ifelse infected-human? = true
  [ask humans in-radius recovery-likelihood [if any? humans in-radius recovery-likelihood with [infected-human? = true]
                                            [
                                             set infected-human? false
                                             set susceptible-human? true
                                            ]
                                           ]
  ]

  [ask humans in-radius death-likelihood [if any? humans in-radius death-likelihood with [infected-human? = true]
                                          [set breed dead]
                                         ]
  ]
  ]





end
+4
source share
1 answer

Good, so the problem is that infected people who are infected do not get infected. If they do not become infected, they obviously cannot infect mosquitoes, which then cannot infect other people. This means that the problem is probably in this line:

if who < initial-infected-people

- who, , , - . , ( - ), . , 5. , , < 5. , . , , , .

, ask-n-of, . - :

breed [humans human]
breed [mosquitoes mosquito]
breed [deads dead]

globals [
  total-human     ;; Total number of agents that are human
  total-mosquito  ;; Total number of mosquitoes that are human
]

humans-own [
  kill                  ;; Agent-subset of mosquitoes within vision
  infected-human?       ;; If true, human is infected
  susceptible-human?    ;; If true, human is susceptible
]

mosquitoes-own [
  infected-mosquito?    ;; If true, mosquito is infected
  susceptible-mosquito? ;; If true, mosquito is susceptible
]

to setup
  ...
  set total-human <some number> (or put on a slider)
  set total-mosquito <some number> (or put on a slider)
  create-humans total-human [<code for shape, position etc]
  ask n-of initial-infected-people humans [set infected-person? TRUE]
  create-mosquitoes total-mosquito [<code for shape, position etc>]
  ...
end
+2

Source: https://habr.com/ru/post/1621771/


All Articles