BIO 200 Antibiotic Resistance

No preview image

1 collaborator

Default-person Rohan Mehta (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.4.0 • Viewed 4 times • Downloaded 0 times • Run 0 times
Download the 'BIO 200 Antibiotic Resistance' 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?

(a general understanding of what the model is trying to show or explain)

HOW IT WORKS

(what rules the agents use to create the overall behavior of the model)

HOW TO USE IT

(how to use the model, including a description of each of the items in the Interface tab)

THINGS TO NOTICE

(suggested things for the user to notice while running the model)

THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)

Comments and Questions

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

Click to Run Model

globals [
  total-sensitive
  total-resistant
  new-location
]

turtles-own [
  resistant ;; boolean
]

patches-own [
  has-antibiotic
]

to setup
  clear-all
  ;; Populate map with bacteria at max population size
  set-default-shape turtles "circle"
  create-turtles max-population-size
  [
    set color white
    set size 1
    setxy random-xcor random-ycor
    set resistant false
  ]
  ask patches [set has-antibiotic false]
  set new-location 2
  reset-ticks
end 

to go
  if ticks = 50 [add-antibiotic]
  let free-patches patches with [has-antibiotic = false]
  let ab-patches patches with [has-antibiotic = true]
  ;; death-birth process with carrying capacity
  ask turtles-on free-patches [
    if resistant = false [ if random-float 1 < death-rate [die]]
    if resistant = true [ if random-float 1 < death-rate-resistance-free [die]]
  ]
  ask turtles-on ab-patches [
    if resistant = true [ if random-float 1 < death-rate [die]]
    if resistant = false [ if random-float 1 < death-rate-susceptible-antibiotic [die]]
  ]
  let to-divide count turtles * birth-rate
  ask n-of to-divide turtles [
      hatch 1 [
        setxy (xcor + (-1 * new-location + random-float 2 * new-location)) (ycor +  (-1 * new-location + random-float 2 * new-location))
        if random-float 1 < mutation-rate [
          set resistant true
          set color random 140
        ]
      ]
    ]
  if count turtles > max-population-size [
    ask n-of (count turtles - max-population-size) turtles [die]
  ]
  let ab-decay floor ((count ab-patches) * antibiotic-clearance-rate)
  ask n-of ab-decay ab-patches [
    set has-antibiotic false
    set pcolor black
  ]
  if not any? turtles [stop]
  tick
end 

to add-antibiotic
  let ab-add floor(count patches * antibiotic-amount)
  ask n-of ab-add patches [  ;; not just free patches!
    set has-antibiotic true
    set pcolor gray
  ]
end 

There are 2 versions of this model.

Uploaded by When Description Download
Rohan Mehta 2 days ago changed no-display Download this version
Rohan Mehta 2 days ago Initial upload Download this version

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.