GvHD and Tregs

No preview image

1 collaborator

Default-person Santiago Rivero (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.2.0 • Viewed 108 times • Downloaded 5 times • Run 0 times
Download the 'GvHD and Tregs' modelDownload this modelEmbed this model

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


Comments and Questions

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

Click to Run Model

breed [grafts graft]
grafts-own [stuck energy]
breed [tregs treg]
breed [tcells tcell]
tcells-own [bound activated]

to setup
  clear-all
  create-tcells 200 [
    set shape "dot"
    set color red
    setxy random-xcor random-ycor
    set bound nobody
    set activated true
  ]
  if mode != "start without graft" [add-grafts]
  setup-membrane
  reset-ticks
end 

to go
  mode-go
  tcells-go
  grafts-go
  tregs-go
  tick
end 

to mode-go
  (ifelse mode = "regular dosage" [if ticks mod 1000 = 1 [add-tregs] ]
    )
end 

to revert-defaults
  set treg-death 0.0020
  set tcell-reactivation 0.003
  set treg-dosage 50
end 

to setup-membrane
  ask patches [set pcolor 134]
  ask patches with [abs pycor = max-pycor] [set pcolor 138]
end 

to add-grafts
  create-grafts 40 [
    set shape "dot"
    set size 4
    set color 19
    setxy random-xcor max-pycor
    if random 2 = 1 [set ycor min-pycor]
    set stuck true
  ]
end 

to tcells-go
  ask tcells [
    ifelse bound = nobody [
      lt 30 - random 60

      ;try not to stick to walls
      if pycor = max-pycor [set heading 180]
      if pycor = min-pycor [set heading 0]

      fd 0.5

      ifelse activated [
        let my-graft one-of grafts-here
        if my-graft != nobody[
          set bound my-graft
        ]
      ]
      [ ; if unactivated, stochastic chance to be activated
        if random-float 1 < tcell-reactivation [set activated true set color red]
      ]
    ]
    [ifelse activated [
      move-to bound
      set heading random 360
      fd random-float 0.3
      ]
      [set bound nobody]
    ]
  ]
end 

to grafts-go
  ask grafts [
    set energy count tcells-here in-radius 1 with [activated]
    set color 19 - energy
    if energy >= 4 [set stuck false]
    if energy >= 10 [die]

    if not stuck [
      lt 30 - random 60
      fd 0.25

      ifelse energy = 0 [
        if pycor = max-pycor [set ycor pycor set stuck true]
        if pycor = min-pycor [set ycor pycor set stuck true]
      ]
      [
        ;try not to stick to walls
        if pycor = max-pycor [set heading 180]
        if pycor = min-pycor [set heading 0]
      ]
    ]
  ]
end 

to add-tregs
  create-tregs treg-dosage [
    set color sky
  ]
end 

to tregs-go
  ask tregs[
    lt 30 - random 60
    fd 0.25

    ;try not to stick to walls
    if pycor = max-pycor [set heading 180]
    if pycor = min-pycor [set heading 0]

    if any? tcells in-radius 1 [
      ask tcells in-radius 1 [
        set activated false
        set color 18
      ]
    ]

    if random-float 1 < treg-death [die]
  ]
end 

There are 8 versions of this model.

Uploaded by When Description Download
Santiago Rivero almost 2 years ago version 1 Download this version
Santiago Rivero almost 2 years ago version 1 Download this version
Santiago Rivero almost 2 years ago version 1 Download this version
Santiago Rivero almost 2 years ago version 1 Download this version
Santiago Rivero almost 2 years ago version 1 Download this version
Santiago Rivero almost 2 years ago update 1 Download this version
Santiago Rivero almost 2 years ago update 1 Download this version
Santiago Rivero almost 2 years ago Initial upload Download this version

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.