NetLogo version NetLogo 3.0.2
Running with NetLogoLite.jar version 302.
NetLogo Version: NetLogo 3.0.2
;;; SUMMARY ;; Cell regneration vs acoustic damage in the vocal folds ;;;; COPYRIGHT ;; Copyright (C) 2005 James P. Steiner ;; All rights reserved ;; Thanks to Nicole Li, lately of the Univerity of Pittsburgh, for describing the intracies of the "inflamation cycle" to me. globals [ ticks ;; hour ;; hour of day date ;; number of the day day ;; day of the week weekday? ;; day 0 -- 4 (no dosage on weekend day 5,6) div-rate ;; hours between mitosis life-span ;; hours cells live, in absense of any stress one-day epi-color bmz-color sllp-color vessel-exterior-color vessel-interior-color ] breeds [ clocks ] patches-own [ status ;; "" = empty, s = sllp, b = epi on bmz, e = epi, ;; c = loosely formed collegen, v = blood vessel, i, vessel interior age div-frame bits ] to startup setup end to setup ca set epi-color pink set bmz-color magenta set sllp-color orange set vessel-exterior-color red set vessel-interior-color violet cct-clocks 1 [ set shape "clock" setxy screen-edge-x - 5 screen-edge-y - 5 set label-color black set size 10 ] set one-day 24 set div-rate one-day set life-span 6 * one-day set ticks -1 let epi-top (- screen-edge-y) + 30 ask patches [ set status "" set div-frame random one-day ] ask patches with [ pycor < epi-top ] [ set pcolor epi-color set status "e" set age (pycor - epi-top) * one-day + random one-day ] ask patches with [ pycor = epi-top - 6 ] [ set pcolor bmz-color set status "b" set age 0 ] ask patches with [ pycor < epi-top - 6 ] [ set pcolor sllp-color set status "s" set age 0 ] let bvw 4 ask patches with [ pxcor mod (bvw * 2 + 1) = int (bvw * 2) and pycor = 0 ] [ ask random-one-of (patches with [ pxcor = pxcor-of myself and status = "s" and pycor < epi-top - 8 - bvw and pycor > (- screen-edge-y - bvw) ]) [ let center self ask patches in-radius-nowrap (bvw) [ set pcolor red set status "w" ] ;; vessel wall ask patches in-radius-nowrap (bvw - 1) [ set pcolor pink set status "i" ] ;; vessel interior ] ] end to go ;; update clock ;; ask patch screen-edge-x screen-edge-y [ set plabel ticks ] set ticks ticks + 1 set hour ticks mod 24 if hour = 0 [ set date date + 1 set day date mod 7 set weekday? day < 5] ask clocks [ rt 15 set label (word date ":" reverse substring reverse ( hour + "0" ) 0 2 " " )] ;; 1 hour per tick ;; once-per-day, apply damage dosage as a near continuous stream at the beginning of the day if working? and weekday? and ticks mod 2 = 0 and hour <= int (dosage / 10) [ ask patches with [ pycor = 0 and random-float 100 * (abs pxcor / screen-edge-x) < (db - 50) ] [ let top-cell patches with [ pxcor = pxcor-of myself and status != "" ] if any? top-cell [ ask max-one-of top-cell [ pycor ] [ dis-cell ] ] ] ] ;; normal wear "ages" exposed cells more quickly... the slough off in 24 hours let wear-and-tear patches with [ (status = "e" or status = "b") and any? neighbors4 with [ status = "" ] ] ask wear-and-tear [ set age age + 1 ] ask patches with [ status = "e" or status = "b" ] [ ifelse age >= life-span [ ;; cell dies dis-cell ] [ set age age + 1 let c 0 ifelse status = "b" [ set c yellow ][ set c violet ] set pcolor scale-color c age (- life-span) (life-span) ] ] ask patches with [ status = "b" and hour = div-frame ] [ ifelse any? neighbors with [ status = "b" or status = "s" ] [ mitosis 0 0 0 "e" timer + 1 ] [ ;; orphan bmz revert to epi set age 0 set status "e" ] ] ;; epis touching bmz and air transform into bmz transform ;; kill orphan cells, not connected to the fold ask patches with [ status != "" and pycor > (- screen-edge-y) ] [ if status-of patch-at 0 -1 = "" and status-of patch-at -1 -1 = "" and status-of patch-at 1 -1 = "" [ dis-cell ] ] ;; dead cells float away ask patches with [ pcolor != black and status = "" ] [ let c random-one-of patches at-points [[ -1 0][ -1 1][0 1][1 1][1 0]] with [ status = "" ] if c != nobody [ set pcolor-of c pcolor * .95] set pcolor black ] diffuse bits .5 ask patches with [ status != "" ] [ set bits 0 ] end to mitosis [ ddx ddy new-age new-status timeout ] if timer > timeout [ stop stop stop] let cell patch-at ddx ddy ifelse cell = self [ set age 0 ;; begin mitosis and migration ;; pick a n4 patch that is not sllp let n4 neighbors4 let t nobody ;; any empty positions? set t n4 with [ status = "" ] set cell nobody ifelse any? t [ set cell random-one-of t ] [ ;; no, any epi positions? set t n4 with [ status = "e" ] if any? t [ set cell random-one-of t ] ] ;; a target direction has been selected, ;; now begin mitosis. ;; mitosis makes the new location cell contain an epi of age 0. ;; if the patch was already occupied, then apply to age, etc ;; of the current patch to the nect patch in that direction, ;; until an empty patch is reached, in effect, bumping all the other ;; cells out of the way ifelse cell = nobody [ stop ] [ set ddx (pxcor-of cell - pxcor) set ddy (pycor-of cell - pycor) mitosis ddx ddy 0 "e" timeout ] ] [ ask cell [ if member? status [ "s" ] or abs (pxcor + ddx) > screen-edge-x or abs (pycor + ddy) > screen-edge-y [ stop ] if status != "" [ mitosis ddx ddy age status timeout ] set age new-age set status new-status ;; promote to BMZ, if appropriate if status = "e" and any? neighbors with [ status = "s" or status = "c" ] [ set status "b" ] ] ] end to transform ask patches with [ status = "e" ] [ let c-b count neighbors4 with [ status = "b" or status = "s" ] if c-b = 1 and c-b = 2 and any? neighbors4 with [ pcolor = black ] [ set status "b" ] ] end to die-cell set age 0 set status "" set pcolor black end to dis-cell set age 0 set status "" set pcolor white set bits 100 end
View or download the complete model file (to download: right-click, save-link-as):
-- Download vocal-fold-5_b4 --