HIV dynamics: cellular automata approach correction

No preview image

2 collaborators

Default-person Andreas Hillmann (Author)
Ricardo_cruz Ricardo Cruz (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 5.1.0 • Viewed 418 times • Downloaded 27 times • Run 0 times
Download the 'HIV dynamics: cellular automata approach correction' 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

Corrected version

Hi Andreas, I coded the other model to get familiar with netlogo and to play a little with a HIV CA model. Thank you for fixing a bug in my implementation. I was going to delete mine (not to confuse anyone), but I see that this website links yours from mine, so people should be able to find it. By the way, I have done some more playing with HIV models, because I got a small research grant on that (it will end soon). I eventually got more into Guillespie models. You have my email.Drop me an email if you would like to share thoughts. :) Best wishes, Ricardo

Posted over 9 years ago

Moore neighborhood

Just noticed a small deviation in our model from the article. The command "neighbors" should be changed to "neighbors4" because the simulations from the original article only consider the von Neumann neighborhood (not the Moore neighborhood). Interestingly, the results DO look identical though.

Posted about 9 years ago

Moore neighborhood 2

Actually, a retification to my previous comment. The paper says, "The updated state of a cell depends on the states of its four nearest neighbors and the four next nearest neighbors", and their following paper "Robustness of a cellular automata model for the HIV infection" reinforces that. So it is a von Neumann neighborhood of radius 2; luckily our Moore neighborhood produces similar results to those of the paper, and is easier to implement over netlogo :P We would require patch-at calls for the entire radius=2 neighboord to be faithful to the model.

Posted about 9 years ago

Moore neighborhood 3

Retification #3. Actually I think I misread "its four nearest neighbors and the four next nearest neighbors". I tried different neighborhood configurations, but I can only reproduce the screenshots from the paper when using Moore neighborhood. So, our code is fine as it is. Sorry for the spam. :P

Posted about 9 years ago

Click to Run Model

; states
; T  healthy
; A1 infected stage 1
; A2 infected stage 2
; D  dead

globals [
  T A1 A2 D  ; status colors
]

patches-own [ nA1 nA2 time ]

to setup
  clear-all

  set T green
  set A1 orange
  set A2 red
  set D black

  ask patches [
    set pcolor T
    set time 0
  ]
  ask n-of (Phiv * max-pxcor * max-pycor) patches [
    set pcolor A1
  ]

  reset-ticks
end 

to-report rule1  ; T - initial healthy state
  if nA1 >= 1 or nA2 >= R [
    report A1
  ]
  report T
end 

to-report rule2  ; A1
  if time >= tao [
    report A2
  ]
  report A1
end 

to-report rule3  ; A2
  report D
end 

to-report rule4  ; D
  if random-float 1 < Prepl [
    if random-float 1 < Pinf [
      report A1
    ]
    report T
  ]
  report D
end 

to update
  ask patches [
    let N neighbors
    set nA1 count N with [ pcolor = A1 ]
    set nA2 count N with [ pcolor = A2 ]
  ]

  ask patches [
    let ncolor pcolor
    ifelse pcolor = T  [set ncolor rule1][
    ifelse pcolor = A1 [set ncolor rule2][
    ifelse pcolor = A2 [set ncolor rule3][
    ifelse pcolor = D  [set ncolor rule4][
    ]]]]

    ifelse ncolor != pcolor [
      set pcolor ncolor
      set time 0
    ][
    set time time + 1
    ]
  ]
  tick
end 

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

Attached files

No files

Parent: HIV dynamics: cellular automata approach

This model does not have any descendants.

Graph of models related to 'HIV dynamics: cellular automata approach correction'