0

I am building a model in Netlogo where I am simulating the spread of a virus. I have looked at other virus models but so far haven't found a solution to my problem.

I would like each agent interaction to have a specific transmission-probability, based on the susceptible agent's susceptibility (agent attribute), the infected agent's (can be more than one) probability of transmitting the virus (agent attribute), as well as the time spent in proximity. Basically P(getting infected)= infectivity * time in proximity * susceptibility. So for each tick that a susceptible turtle is close to a infected one the probability of getting infected should increase. So far I have only managed to use susceptibility when creating the procedure with susceptible agents as callers.

Here is my code for this procedure so far:

to transmit; procedure for transmitting the disease to nearby people, inspired by epiDEM
  let caller self ; adress the susceptible turtle by the name caller
  if susceptible? = TRUE
  [
  let nearby-infected turtles in-radius 2 with [infected? = TRUE]
  if nearby-infected != nobody
    [      
      let transmission-risk age-susceptibility ;here I want to include protective-measures (attribute of the possibly several infected turtles) and time-exposed
    if random-float 1 < transmission-risk[
      set infected? TRUE set susceptible? FALSE]
    ]
  ]
end

I am really having a hard time on how to go about this, I am not sure how to address the attributes of the turtles within the radius and how I could measure the time of exposure. I was thinking of creating links that have exposure time as an attribute that will die when the infected is no longer in the radius. But I am not sure how to ask the links to die when the turtles are further away from each other than a 2 patch radius. Also I would prefer to not use links to keep the model runnning faster so if there is another solution I would be very happy to hear it :)

For the option with the links I wanted to try something like this:

to transmit; procedure for transmitting the disease to nearby people
ifelse link-neighbors (in-radius 2 = FALSE)
[ask link [die]]
[set link-age link-age + 1]
  
  let caller self ; adress the susceptible turtle by the name caller
  if susceptible? = TRUE
  [
  let nearby-infected turtles in-radius 2 with [infected? = TRUE]
  if nearby-infected != nobody
    [create-links-with nearby-infected
      let transmission-risk age-susceptibility ;include protective-measures and time-exposed using links to address the turtles
      if random-float 1 < transmission-risk[
      set infected? TRUE set susceptible? FALSE]
    ] 
  ]

However I for starters just don't understand how to address the links of the turtles further away to ask them to die, I have changed it after the error messages I've gotten but just can't seem to get it to work.

Is it even possible to do what I want in Netlogo?

Very thankful for any hints!

Johanna
  • 11
  • 4
  • 1
    You have far too many questions here, can you focus on just getting one of them clear and we can try and resolve that first. To help that, links is the way to deal with the duration issue since a link represents a relationship between a pair of turtles (in this case the relationship is being near each other). Then ask the turtles to ask their links how far the other turtle is and die if too far or increase duration if near enough – JenB Mar 20 '21 at 13:07
  • Thank you JenB for your input! I realized that the duration aspect is in a way resolved by itself since the transmission procedure is repeated with every tick, so if the turtles stay together longer the probability will automatically get higher. As I am quite unfamiliar with links and under heavy time pressure I have chosen not to use them for now and just focus on susceptibility in the procedure while perfecting other parts of the model. – Johanna Mar 30 '21 at 20:00

0 Answers0