RP4 CVTD NetLogo Model – Pre-Release Beta 2.0

RP4 CVTD NetLogo Model – Pre-Release Beta 2.0 preview image

1 collaborator

Default-person Monish Ahluwalia (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.2.1 • Viewed 273 times • Downloaded 26 times • Run 0 times
Download the 'RP4 CVTD NetLogo Model – Pre-Release Beta 2.0' modelDownload this modelEmbed this model

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


WHAT IS IT?

This model is a simplification of the model we hope to produce for our research. The current model simulates a closed environment consisting of stray dogs, some of which are infected with Canine Venereal Tumour Disease (CVTD). This disease is ubiquitous among canine species and is tranmitted sexually or from dam to pup. This model can answer the question of how many dogs in a certain population would have to be treated to eradicate the disease from a certain environment. This environment is based on user-set parameters defined by the sliders on the left-hand side of the user interface. The output of set of parameters that creates a sustainable population will result in a sinusoidal function that defines the number of infected, immune, and vulnerable dogs. The average of this function will define the number that we seek.

HOW IT WORKS

In this environment, dogs will roam freely in the environment until they are in close proximity to another dog. In this situation, the two dogs will "couple". You can see when dogs are coupling by a pairing of the two dogs and a light-grey box that surrounds them. When coupled, dogs can both reproduce, infect each other, and infect their child. This is the basis for reproduction and infection in the model and is defined by the "copuling-frequency", "coupling-time" and transmission sliders. After a certain period of time defined by "coupling-time", the dogs will "uncouple" and return to roaming about the environment.

Every dog has 3 possible statuses: Vulnerable, Infected, and Immune. A vulnerable dog is one that is susceptible to the disease and is shown in green. An infected dog is one with CVTD and the potential to spread it to other dogs. It is shown in red. An immune dog is one that has recovered from CVTD and is no longer susceptible or contagious. It is shown in grey.

HOW TO USE IT

Buttons:

Setup - Sets up the environment based on the adjusted parameters. Go - Starts the simulation. It can be sped up using the speed slider at the top of the interface.

Sliders:

number-dogs – Sets the initial total number of dogs in the environment. number-infected – Sets the initial number of infected dogs in the environment. If this is set higher than "number-dogs", it will rever to "number-dogs". reproduction-rate – Sets the chance in which two dogs will reproduce when coupled. 100% results in a 50% chance of reproduction for any one coupling incidence. It is possible that a single couple can produce two pups. carrying-capacity – Sets the maximum number of dogs that can exist in the environment at one time. transmission-rate-during-birth – Sets the chance in which a couple whereby one of the parents is infected will transfer the infection to their offspring. transmission-rate-between-dogs – Sest the chance in whcih a dog will spread the infection from one dog to its current partner during coupling. maximum-dog-age – Sets the maximum time in which the dogs will live in the system. A single "tick" or movement is set at 0.1 years. recovery-time – Sets the time that a dog takes to recover from the disease. After this time, the dog will recover and become immune to the disease. coupling-frequency – The frequency by which two dogs that find themselves in close proximity will couple. A higher frequency results in a higher number of couples forming, more children, and a higher spread of infection. This chance is the set number divided by 10. Note that it cannot be set at 100% since that would result in a couple "uncoupling" and then immediately thereafter, "recoupling". coupling-time – The time in which couples stay together. A longer coupling-time results in a lower spread of disease due to an infected dog having less sexual partners.

Monitors:

On the right-hand side of the interface, a series of monitors can be found. These monitors show the current number of dogs that fall under each status: Vulnerable, Infected, and Immune. The number of healthy dogs is represented by a combination of the number of vulnerable and immune dogs (which can also be interpreted as the number of dogs that are not sick). These monitors can be used to quickly interpret the status of hte model.

Graph:

The graph on the bottom left of the interface plots the numbers that the monitors show over the course of the simulation. A legend is in place that defines each line.

THINGS TO NOTICE

When you have created a sustainable environment of dogs and infection, there should be a sinusoidal pattern visible in the graphs. From this result, you can take the average as the number of infected dogs that would need to be treated to eradicate the disease from this environment.

THINGS TO TRY

Try to create sustainable models that result in this sinusoidal pattern. You can then try to create models that result in a very high equilibrium number of infected dogs and one with a relatively low number of infected dogs.

EXTENDING THE MODEL

There are many ways that this model can be expanded and these are outlined in our report titled, "A Modelling of the Interaction Between Stray and Pet Dogs in CVTD Contaminated Environments Using NetLogo".

RELATED MODELS

This model is based off the AIDS and Virus models present in the Model Library that comes preloaded when installing NetLogo.

CREDITS AND REFERENCES

This model has been coded by Monish Ahluwalia for the Cancer Research Project in iSci 1A24. It is being submitted in combination with a group report titled, "A Modelling of the Interaction Between Stray and Pet Dogs in CVTD Contaminated Environments Using NetLogo" for the group consisting of Monish Ahluwalia, Pascale Bider, Sonya Cui, Ashlyn Leung, and Urszula Sitarz. It is based off of code from the AIDS and Virus models that can be found in the Model Library.

Comments and Questions

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

Click to Run Model

breed [dogs dog]
breed [dogs2 dog2]

turtles-own
[
  sick?
  immune?
  healthy?
  age
  infected-time
  coupled?
  coupled-time
  partner
]

globals
[
  number-infected
  number-healthy
  number-immune
  number-vulnerable
]

;; Designates the command for the setup button.

to setup
  clear-all
  setup-turtles
  reset-ticks
end 

;; Creates a number of turtles with random position. The designated number of infected turtles are instructed
;; to "get-sick". Also, it prevents the number of infected dogs from being larger than the total number of dogs
;; and the recovery time from being larger than the maximum dog age. Finally, there are two identical shapes for
;; the dogs. This is to help with the coupling code as explained later.

to setup-turtles
  create-turtles number-dogs
  [ setxy random-xcor random-ycor
    set size 1.5
    set color green
    set healthy? true
    set sick? false
    set immune? false
    set age 0 + random 5
    set coupled? false
    set coupled-time 0
    ifelse random 2 = 0
    [ set shape "dog"]
    [ set shape "dog 2"]
  ]
  if number-infected-dogs > number-dogs [set number-infected-dogs number-dogs]
  if recovery-time > maximum-dog-age [set recovery-time maximum-dog-age]
  ask n-of number-infected-dogs turtles
  [get-sick]
end 

;; Instructions of how a turtle gets sick. They turn red and stay sick for a certain amount of time defined by the recovery-time slider.

to get-sick
  set sick? true
  set healthy? false
  set immune? false
  set color red
  set infected-time 0
end 

;; Instructions of how a turtle gets better. They turn grey because they are now immune to the disease. There is also
;; a certain chance that the cancer will metastasize, resulting in death. This is defined as 5% from research.

to get-better
  set sick? false
  set immune? true
  set healthy? false
  set color grey
  ;if random-float 100 < 1 [die]
end 

;; What happens when the user presses the "go" button. It involves the turtles moving and getting older.
;; If a turtle is sick, every move it takes, that time is added to its infected-time
;; If that infected time is greater than the time for recovery (user-defined), then it undergoes get-better.
;; Global variables are also updated (counting for the monitors and graph).
;; To simplify the coding, dogs with the shape of "dog 2" are always the ones to initiate coupling.
;; If a turtle is not coupled, it will go down to different pathways, depending on if it is sick or not. If the
;; "dog 2" dog is sick, it will go down the "sick-couple" pathway, while healthy "dog 2"'s will go down the couple pathway.
;; If a turtle is coupled and has been for longer than the user defined couple-time, then it will uncouple.

to go
  ask turtles [
    if coupled? = false [move]
    if coupled? = true
    [ set coupled-time coupled-time + 0.1]
    if sick? = true
      [set infected-time infected-time + 0.1]
    if infected-time > recovery-time [get-better]
  if coupled? = false and (healthy? = true or immune? = true) and shape = "dog 2" and (coupling-frequency > random-float 10) [couple]
  if coupled? = false and sick? = true and shape = "dog 2" and (coupling-frequency > random-float 10) [sick-couple]
  if coupled-time > coupling-time and shape = "dog 2" [uncouple]
  get-older
  ]
  update-global-variables
  tick
end 

;; Moves randomly

to move
  rt random 100
  lt random 100
  fd 1
end 

;; A turtle gets older with every tick (defined as 0.1 years).
;; If it's age is greater than the user-defined max dog age, it dies :(.

to get-older
  set age age + 0.1
  if age > maximum-dog-age [die]
end 

;; Coupling code. All healthy "dog 2"'s will go through "couple" while all infected "dog 2"'s will go through "sick-couple".
;; Once down this path, the two turtles of different shapes next to eachother will be paired together and be surrounded by
;; a grey box. If dog 2 is healthy and its partner is sick, it's partner can infect it and vice versa.

to couple
  let potential-partner one-of (turtles-at -1 0) with [coupled? = false and shape = "dog"]
  if potential-partner != nobody
  [ set partner potential-partner
    set coupled? true
    ask partner [ set coupled? true]
    ask partner [ set partner myself]
    set pcolor grey - 3
    ask (patch-at -1 0) [set pcolor grey - 3]
    move-to patch-here
    ask partner [move-to patch-here]
    ask partner [infect]
    ]
end 

to sick-couple
  let potential-partner one-of (turtles-at -1 0) with [coupled? = false and shape = "dog"]
  if potential-partner != nobody
  [ set partner potential-partner
    set coupled? true
    ask partner [ set coupled? true]
    ask partner [ set partner myself]
    set pcolor grey - 3
    ask (patch-at -1 0) [set pcolor grey - 3]
    move-to patch-here
    ask partner [move-to patch-here]
    infect
    ]
end 

;; Uncoupling code. After a user-defined amount of time, a couple will break apart and will have an opportunity
;; to reproduce.

to uncouple
  set coupled? false
  set coupled-time 0
  set pcolor black
  ask (patch-at -1 0) [set pcolor black]
  if partner != nobody
  [ask partner [ set coupled-time 0]
  ask partner [ set partner nobody]
  ask partner [ set coupled? false]
  set partner nobody]
  make-babies
end 

;; Infection can only take place if the dogs are coupled and one of the dogs is infected.

to infect
  if coupled? = true and partner != nobody
  [ if transmission-rate-between-dogs > random-float 200 and immune? = false
    [ ask partner [ get-sick]]]
end 

;; Making babies can only take place if the dogs are coupled and the total number of dogs is less than
;; the carrying capacity. If one of the dogs is sick, then there is a chance that the offspring will be
;; infected. Since there are two shapes of dogs that can be created, there are two chances to reproduce.
;; This is why the chance is based off a random number from 0 to 400. The slider has a maximum of 200
;; and while this does not mean that every couple will have a child, it results in a similar result
;; as if a single dog could be produced based off a random number from 0 to 200. This also creates the
;; possibility that a single couple can produce two offspring.

to make-babies
  if random-float reproduction-rate > random 400 and count turtles < carrying-capacity
  [hatch-dogs 1
    rt random-float 360
    fd 1
    set age 0
    set immune? false
    set color green
    if sick? = true and transmission-rate-during-birth > random 200 [get-sick]
    ]
  if random-float reproduction-rate > random 400 and count turtles < carrying-capacity
  [hatch-dogs2 1
    rt random-float 360
    fd 1
    set age 0
    set immune? false
    set color green
    if sick? = true and transmission-rate-during-birth > random 200 [get-sick]
    ]
end 

;; Updating required for the graphs and monitors to keep up with the simulation.

to update-global-variables
  if count turtles > 0
  [ set number-infected (count turtles with [sick? = true])
      set number-healthy (count turtles - number-infected)
      set number-immune (count turtles with [immune? = true])
      set number-vulnerable (count turtles - (number-infected + number-immune))]
end 

There is only one version of this model, created over 9 years ago by Monish Ahluwalia.

Attached files

File Type Description Last updated
RP4 CVTD NetLogo Model – Pre-Release Beta 2.0.png preview Preview for 'RP4 CVTD NetLogo Model – Pre-Release Beta 2.0' over 9 years ago, by Monish Ahluwalia Download

This model does not have any ancestors.

This model does not have any descendants.