ABM_CC

ABM_CC preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Part of project 'HPV-CC'
Visible to everyone | Changeable by the author
Model was written in NetLogo 5.0.5 • Viewed 434 times • Downloaded 29 times • Run 0 times
Download the 'ABM_CC' 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


globals[ dado dado2 n-cell n-cell-cn1 n-cell-cn2 n-cell-cn3 ncc n-cell-l  n-cell-del n-cell-ndel T P]
turtles-own [crbp egfr psgs p53 rb cn1 cn2 cn3 cr clr edad]
patches-own [espacio]
;extensions [matrix rserve]
;extensions [r]

to setup
  __clear-all-and-reset-ticks
  set-default-shape turtles "circle"
  crt cuantos 
  ask turtles [set xcor random 100  set ycor -100  set color red fd 1]
  ask patches [if (any?  turtles-here = true)[set espacio false]]
  ask patches [if (espacio = false)[ask one-of turtles-here [fd 1]]]
  set-patch-size 20
  resize-world -10 10 -10 10
  ask patches [set pcolor grey ]
  ask turtles [set crbp  0  set egfr  0 set psgs 0 set p53  0  set rb 0  set clr color set edad 0 set cn1 false set cn2 false set cn3  false]
  set n-cell count turtles
  set ncc 0
  set P (random 6 + random 6)
  set T 0
  set n-cell-del count turtles with [egfr > 0]
  set n-cell-ndel count turtles with [crbp > 0]
  show (random 2) - (random 3)
end 

to go
  ;movie-start "peli.mov"
  ;movie-grab-view 
  ;repeat 30
  ask turtles [if (any? other turtles-here )[fd 1]]
  ask turtles [set edad edad + 1 ]
  ask n-of 80 turtles [divide]
  ask n-of 10 turtles [lesion_cn1 lesion_cn2 lesion_cn3]
  set n-cell count turtles
  set n-cell-cn1 count turtles with [cn1 = true]
  set n-cell-cn2 count turtles with [cn2 = true]
  set n-cell-cn3 count turtles with [cn3 = true]
  if  n-cell > 350 [muerte]
  CNR
  QT
  QIR
  grafica
  set T T + 1
  set n-cell-del count turtles with [egfr > 0]
  set n-cell-ndel count turtles with [crbp > 0]
  tick
  if T = 20000 or ncc >= floor (0.75 * n-cell)[ print ("fin de la simulaciĆ³n") stop]
  ;movie-grab-view 
  ;movie-close
end 

to divide
  if edad >= 1 [ifelse vph_ = true [ifelse color != black  [hatch 1  [set crbp  ((random 2) - (random 3))  set egfr ((random 2) - (random 3)) set psgs ((random 2) - (random 3))  set p53  ((random 2) - (random 3)) 
  set rb ((random 2) - (random 3))  set edad 0 fd 1 if (any? other turtles-here )[fd 1] set color red set clr color colorear   set cn1 false set cn2 false set cn3 false]]
  [ifelse tratamiento1 = true [if edad >= 6[die]][hatch 1[set crbp ((random 2) - (random 3))  set egfr ((random 2) - (random 3)) set psgs ((random 2) - (random 3))  set p53  ((random 2) - (random 3)) 
  set rb ((random 2) - (random 3))  set edad 0 fd 1 if (any? other turtles-here )[fd 1] set color black set clr color] set cn3  true]]][hatch 1 [set crbp  0  set egfr  0 set psgs 0 set p53  0  set rb 0  
  set clr color set edad 0 set cn1 false set cn2 false set cn3  false if (any? other turtles-here )[fd 1]] ]]
end 

to colorear
  ifelse crbp = 0 [set color clr][ifelse crbp > 0 [set color clr + random-float 3][set color clr - random-float 3]]
  ifelse egfr = 0 [set color clr][ifelse egfr > 0 [set color clr - random-float 3][set color clr + random-float 3]]
  ifelse psgs = 0 [set color clr][ifelse psgs > 0 [set color clr + random-float 3][set color clr - random-float 3]]
  ifelse p53 = 0 [set color clr][ifelse p53 < 0 [set color clr + random-float 3][set color clr - random-float 3]]
  ifelse rb = 0 [set color clr][ifelse rb < 0 [set color clr + random-float 3][set color clr - random-float 3]]
  if clr = white [set color 13]
end 

to muerte
  ask n-of por_morir turtles [if edad >= 12  or (color = black and edad >= 8) or (p53 < 0 and edad >= 12) or (rb < 0 and edad >= 12) [ die ]]
end 

to lesion_cn1
set dado  random 6  
set dado2 random 6
if vph_ = true and (dado + dado2) = 2 [ask n-of (floor(0.3 * (n-cell)) )turtles [if (P != 7 and P > 6) [set cn1 true]]]
end 

to lesion_cn2
set dado random 6
set dado2 random 6
if vph_ = true and (dado2 + dado) = 5 [ask n-of (floor(3 * (n-cell-cn1))/(10)) turtles with [cn1 = true] [if  (P != 7 and P > 2) [set cn2 true]]]
end 

to lesion_cn3 
set dado random 6  
set dado2 random 6
if vph_ = true and (dado2 + dado) = 7 [ask n-of (floor((3 * (n-cell-cn2))/(10))) turtles with [cn1 = true and cn2 = true][if  P != 7 [set cn3 true]]]
end 

to grafica
  plot n-cell 
  plot n-cell-cn1 
  plot n-cell-cn2 
  plot n-cell-cn3
end 

to CNR
 set dado random 6
 set dado2 random 6
 ask turtles [if cn3 = true  and egfr > 0 and (dado + dado2) != 7 [set color black set clr color]]
 set ncc count turtles with [color = black]
end 

to QT
  if tratamiento1 = true  [ask turtles with [cn3 = true][ifelse crbp >= 0 and egfr < 0 [set color red set clr color colorear][set color black set clr color]]]  
end 

to QIR
  if tratamiento2 = true [ask turtles with[color = black][die]]
end 

  

There are 2 versions of this model.

Uploaded by When Description Download
Augusto Cabrera-Becerril about 7 years ago Late version Download this version
Augusto Cabrera-Becerril over 7 years ago Initial upload Download this version

Attached files

File Type Description Last updated
ABM_CC.png preview preview about 7 years ago, by Augusto Cabrera-Becerril Download

This model does not have any ancestors.

This model does not have any descendants.