ABM Lassa Virus Transmission

ABM Lassa Virus Transmission preview image

This model is seeking new collaborators — would you please help?

1 collaborator

Default-person Victor Odoh (Author)

Tags

agent-based model 

Tagged by Victor Odoh over 1 year ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.3.0 • Viewed 204 times • Downloaded 6 times • Run 0 times
Download the 'ABM Lassa Virus Transmission' modelDownload this modelEmbed this model

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


Info tab cannot be displayed because of an encoding error

Comments and Questions

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

Click to Run Model

; ABM - LASSA FEVER TRANSMISSION
; STUDENT NAME: VICTOR ODOH
; ID: C2397722
; SCEDT, TEESSIDE UNIVERSITY
; Year: 2022




; Two agentsets are involved in this Model (Humans and rats)
; Hence defining two breeds as follows
breed [humans human]
breed [rats rat]

;       COLOUR CODES:
; Red rat (red - 2) - Multimammate Rat (All Assumed to be infectious)
; White Human - Healthy, not infected/infectious
; Yellow Human - Infected but not infectious (within virus incubation period)
; Orange Human (orange + 2) - Infectious with Mild Symptoms
; Red Human - Infectious with Severe Symptoms
; Cyan Human - Recovered, immune but still Infectious
; Lime Human (lime + 1) - Fully recovered and immune
; Gray Human - Dead


; Declaring humans owned variables
humans-own [
  hours            ; each tick represents an hour
  human_speed      ; to control human speed
]

; Declaring all global variables used...
; (excluding the sliders which do not need to be declared here)
globals [
  control_speed               ; to regulate speed of model
  infected_not_infectious     ; current count of infected humans within virus incubation period
  initial_mild_cases
  initial_severe_cases
  mild_cases_count         ; current count of all mild cases
  severe_cases_count       ; current count of all severe cases
  severe_cases             ; counting variable for infected humans with severe symptoms
  mild_cases               ; counting variable for infected humans with mild symptoms or asymptomatic
  total_mild_cases         ; includes intial mild cases
  total_severe_cases       ; includes initial severe cases
  fatalities               ; counting variable for human deaths
  total_fatalities         ; count of all deaths ever recorded
  immune_infectious      ; current count of recovered and immune humans that are still carriers
  immune_not_infectious  ; current count of immune humans who are no longer carriers
  %Mild_Cases
  %infected
  %uninfected
  %immune
  average_%CFR           ; average case fatality rate in percentage

  immune_or_severe_%infectiousness     ; virus spread chance of immune/recovered carriers
                                       ; or humans with severe symptoms assuming that they are hospitalized/isolated and pose little
                                       ; risk of infecting others

  current_cases       ; number of cases at the curent time
  total_cases         ; Count of all cases ever recorded : addition of counting variables (mild_cases + severe_cases)
  total_immune        ; includes both immune carriers and immune with no virus
  total_infected      ; all carrier humans
  total_infectious    ; all carrier humans excluding infected_not_infectious
]

; Defining the "setup" command procedure:
; Assigning initial values

to setup
  clear-all
  reset-ticks
  set %Mild_Cases (100 - %Severe_Cases)
  set initial_mild_cases (Initial_Number_Of_Cases * %Mild_Cases) / 100
  set initial_severe_cases (Initial_Number_Of_Cases * %Severe_Cases) / 100
  set immune_or_severe_%infectiousness %Infectiousness_Human_to_Human * (1 - Human_Behaviour_Factor)

  ; Declaring basic constant of the model
  set control_speed 1


  ; creating the rat agents with their properties
  ; Distributing them randomly across the patches/world
  create-rats Multimammate_Rat_Population [
    setxy random-xcor random-ycor
    set shape "mouse side"
    set color red - 2
    set size 0.8
  ]

  ; creating the human agents with initially infected humans
  ; Distributing them randomly across the patches/world
  create-humans Human_Population [
    setxy random-xcor random-ycor
    set shape "person"
    set color white
    set size 1
    set human_speed control_speed
  ]

  ; color coding to identify initial mild/severe cases
  ask n-of initial_mild_cases Humans
   [set color orange + 2]
  ask n-of initial_severe_cases Humans
   [ set color red ]
end        ; end of setup command procedure

; Defining the "go" command procedure:

to go
  ; asking rats to move randomly across the world
  ask rats [
    fd control_speed * -1 * ((1 / Human_Behaviour_Factor) * 0.01)
    rt random 100 lt random 100
  ]
  ; asking humans to move randomly across the world
  ask humans [
    fd human_speed * ((1 / Human_Behaviour_Factor) * 0.01)
    rt random 45 lt random 45
    set hours hours + 1    ; advancing hours counting variables
  ]

  ; asking humans that are infectious and applying human to human infection probability..
  ; ..to a nearby uninfected human, for possible infection
  ; color coding to identify each case
  ask humans [
    ifelse (color = orange + 2) [
      ask other humans-here [
        if random 100 < %Infectiousness_Human_to_Human [
          if color = white [
            set color yellow
            set infected_not_infectious infected_not_infectious + 1
            set hours 0
          ]
        ]
      ]
    ]

    ; asking rats and applying rat to human infection probability
    ; to nearby uninfected human in contact, for possible infection
    [
      ask rats [
        ask other humans-here [
          if random-float 100 < %Infectiousness_rat_to_Human [
            if color = white [
              set color yellow
              set hours 0
            ]
          ]
        ]
      ]
    ]

    ; If hospitalized or immune carrier, applying infection probability for possible infection...
    ; ... of other uninfected humans nearby
    if (color = cyan) or (color = red) [
      ask other humans-here [
        if random-float 100 < immune_or_severe_%infectiousness [
          if (color = white) [
            set color yellow
            set hours 0
          ]
        ]
      ]
    ]

    ; converting incubation period in days to hours
    ; what should happen if infection has exceded incubation period?
    ; applying %Severe_Cases probabilty to determine if an infected human...
    ; ... falls under the mild or severe case
    if (color = yellow) and (hours > (incubation_Period * 24)) [
      ifelse random-float 100 < %Severe_Cases [
        set color red
        set severe_cases severe_cases + 1   ; advancing severe_cases counting variable
        set hours 0
        set human_speed 0          ; if severe, assumes human is hospitalized and stops moving
      ]
      [
        set color orange + 2
        set mild_cases mild_cases + 1       ; advancing mild_cases counting variable
        set hours 0
        set human_speed 0.5        ; value assigned to variable to make speed a bit slower than that of other agents
      ]
    ]


    ; converting "days before recovery or death" in days to hours
    ; what should happen if infection has lingered for this period?
    ; applying case fatality probabilty of both type of cases to determine...
    ; ... if an infected human dies or survives
    ; "orange + 2" for mild case, red for severe case
    if (color = orange + 2) and (hours = (Sick_Days * 24)) [
      ifelse random-float 100 < CFR_Mild_Case [
        set color gray
        set fatalities fatalities + 1        ; advancing fatalities counting variable
        set hours 0
        set human_speed 0            ; if dead, human stops moving
      ]
      [
        set color cyan               ; if they survived, they become immune but still carriers (cyan from color coding)
        set hours 0
        set human_speed 0.5
      ]
    ]

    if (color = red) and (hours = (Sick_Days * 24)) [
      ifelse random-float 100 < CFR_Severe_Case [
        set color gray
        set fatalities fatalities + 1
        set hours 0
        set human_speed 0
      ]
      [
        set color cyan
        set hours 0
        set human_speed control_speed
      ]
    ]

    ; what should happen if immune carriers have exceeded the Infectious days after recovery?
    ; mark them as immune and no longer infectious (Lime)
    if (color = cyan) and (hours = (Infectious_Days_After_Recovery * 24)) [
      set color lime + 1       ; lime human is immune and no longer infectious
      set hours 0
      set human_speed control_speed
    ]
  ]

  ; Updating global variables for plotting purposes and for output display on monitor
  set infected_not_infectious count humans with [color = yellow]
  set mild_cases_count count humans with [color = orange + 2]
  set severe_cases_count count humans with [color = red]
  set immune_infectious count humans with [color = cyan]
  set immune_not_infectious count humans with [color = lime + 1]
  set total_immune (immune_infectious + immune_not_infectious)
  set current_cases (mild_cases_count + severe_cases_count)
  set total_mild_cases (mild_cases + initial_mild_cases)
  set total_severe_cases (severe_cases + initial_severe_cases)
  set total_cases (total_mild_cases + total_severe_cases)
  set total_infectious (current_cases + immune_infectious)
  set total_infected (infected_not_infectious + total_infectious + total_fatalities)
  set total_fatalities count humans with [color = gray]
  set average_%CFR (fatalities / total_cases) * 100
  set %infected (total_infected / Human_Population) * 100
  set %uninfected ((count humans with [color = white]) / Human_Population) * 100
  set %immune (total_immune / Human_Population) * 100

  if infected_not_infectious + current_cases + count humans with [color = white] = 0 [stop]   ; condition (if true) to halt simulation
  tick     ; advancing the tick counter by 1
end 

There is only one version of this model, created over 1 year ago by Victor Odoh.

Attached files

File Type Description Last updated
ABM Lassa Virus Transmission.png preview Preview for 'ABM Lassa Virus Transmission' over 1 year ago, by Victor Odoh Download

This model does not have any ancestors.

This model does not have any descendants.