I am practicing my Netlogo skills by trying to simulate viral infection rate in a closed environment. The simulation I came up with runs well, but after reviewing the results something seems off in terms of how agents infect other agents. Here is my "infection" code ("normals" are healthy people while "carriers" are the opposite):
ask carriers [
if any? other normals-here [
let r random 50
if r < 50 [set virus? false]
if r < 50 + Infectivity [
ask normals-here [set virus? true]
ask normals-here [set color red]
]
]
]
My general idea is that, in an interaction on the same patch between a carrier and a normal agent, if a normal agent has r + infectivity (a controlled variable in the simulation, with a rate of 0-50) = a number larger than 50, then the agent gets the virus. I want each normal agent to have a random r variable of 0-50, and if that variable grows larger than 50 when the "infectivity" rate is added, that agent receives the virus. If the r remains lower than 50 upon adding the "infectivity" rate, he remains "normal".
does my code seem ok? I feel like something is off here but I cant quite see it.