Zika babies and women's life-history
Model was written in NetLogo 5.3.1
•
Viewed 253 times
•
Downloaded 17 times
•
Run 0 times
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
extensions [ nw ] globals [ culture-breastfeeding-maximum zika-monthly-recovery-chance zika-births ] turtles-own [ age infected? contracepting? menopause? fertile? pregnant? months-pregnant months-postpartum breastfeeding ideal-family-size parity fear foolhardy bore-zika-baby ] to setup clear-all set culture-breastfeeding-maximum 7 set zika-monthly-recovery-chance 10 set zika-births 0 nw:generate-preferential-attachment turtles links n-agents [ ;; initialise agent counters and Boolean variables set parity 0 set months-pregnant 0 set months-postpartum 0 set pregnant? FALSE set menopause? FALSE set fertile? TRUE set contracepting? FALSE set infected? FALSE set bore-zika-baby 0 set fear 0 set foolhardy random 30 ;; age of agent in years set age 21 + random 10 ;; how many offspring agent wants set ideal-family-size random-poisson culture-ideal-family-size set shape "person" set color white setxy random-xcor random-ycor if show-labels? [ set label (word age " " parity " " ideal-family-size " " months-pregnant " " months-postpartum) ] ] repeat 300 [ layout-spring turtles links 0.2 7 1.3 ] reset-ticks end to go ask turtles [ ;; pregnant women only ifelse pregnant? [ set months-pregnant months-pregnant + 1 if months-pregnant > 9 [ birth ] ] ;; non-pregnant women [ if months-postpartum > 0 [ set fertile? FALSE set months-postpartum months-postpartum - 1 ] ifelse menopause? [ set fertile? FALSE ] [ decide-contracept ] if fertile? [ if random 100 > 90 [ conceive ] ] ] ;; all women if infected? [ if random 100 < zika-monthly-recovery-chance [ set infected? FALSE set pcolor black ] ] if random 100 < zika-prevalence * 10 [ set infected? TRUE set pcolor brown ] calculate-fear colour-status if show-labels? [ set label (word age " " parity " " ideal-family-size " " months-pregnant " " months-postpartum) ] ] ;; end of main ask turtles if all? turtles [ menopause? = TRUE OR parity = ideal-family-size ] [ stop ] age-increment tick end to colour-status ifelse pregnant? [ set color red ] [ if months-postpartum = 0 [ set color white ] ] ifelse months-postpartum > 0 [ set color blue ] ;; not postpartum [ if contracepting? [ set color green ] ] if menopause? = TRUE [ set color grey ] end to conceive set pregnant? TRUE set months-pregnant 1 end to birth if infected? [ zika-birth ] ;; add 1 to number of offspring ever birthed by this agent set parity parity + 1 set pregnant? FALSE set months-pregnant 0 set breastfeeding random culture-breastfeeding-maximum ;; number of months before agent regains possibility of conceiving set months-postpartum 1 + breastfeeding end ;; every 12th month, age of all agents is incremented by 1 year to age-increment if ticks mod 12 = 0 [ ask turtles [ set age age + 1 ;; annual check for menopause starting if menopause? = FALSE [ if age > 40 [ if random 100 < 10 [ set menopause? TRUE ] ] if age > 50 [ if random 100 < 50 [ set menopause? TRUE ] ] if age > 55 [ set menopause? TRUE ] ] ] ] end to calculate-fear ;; initialise local variables let background 0 let impact-of-self-infected 0 let impact-of-self-bearing-zika-baby 0 let n-friends-infected 0 let impact-of-friend-infected 0 let n-friends-had-zika-baby 0 let impact-of-friend-having-zika-baby 0 let n-others-had-zika-baby 0 let impact-of-others-having-zika-baby 0 set background ( zika-prevalence * 10 ) ;; self is infected if infected? [ set impact-of-self-infected 30 ] if bore-zika-baby > 0 [ set impact-of-self-bearing-zika-baby 80 ] ;; friend is infected set n-friends-infected ( count link-neighbors with [ infected? ] ) set impact-of-friend-infected ( n-friends-infected * 10 ) ;; friend bore Zika baby set n-friends-had-zika-baby round ( sqrt count link-neighbors with [ bore-zika-baby > 0 ] ) set impact-of-friend-having-zika-baby ( n-friends-had-zika-baby * 40 ) ;; other bore Zika baby set n-others-had-zika-baby ( zika-births - n-friends-had-zika-baby ) set impact-of-others-having-zika-baby ( round ( sqrt n-others-had-zika-baby * 10 ) ) set fear background + impact-of-self-infected + impact-of-self-bearing-zika-baby + impact-of-friend-infected + impact-of-friend-having-zika-baby + impact-of-others-having-zika-baby - foolhardy ;; debugging the components of fear ;; show ( word background " FI:" impact-of-friend-infected " FB:" impact-of-friend-having-zika-baby " O:" impact-of-others-having-zika-baby " R:-" foolhardy ) end to decide-contracept set contracepting? FALSE set fertile? TRUE let contracept? FALSE ;; family incomplete so maybe try for conception if not too risky ifelse parity < ideal-family-size [ if random 100 < fear [ set contracept? TRUE ] ] ;; family complete [ set contracept? TRUE ] if contracept? [ set contracepting? TRUE set fertile? FALSE ] end to zika-birth ;; record that agent had a Zika-affected baby set bore-zika-baby bore-zika-baby + 1 ;; increment cohort total set zika-births zika-births + 1 end
There is only one version of this model, created over 7 years ago by John McKeown.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Zika babies and women's life-history.png | preview | Preview for 'Zika babies and women's life-history' | over 7 years ago, by John McKeown | Download |
This model does not have any ancestors.
This model does not have any descendants.