Birth Number and Intervals

Birth Number and Intervals preview image

1 collaborator

Default-person Stephen Cranney (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.0.4 • Viewed 183 times • Downloaded 13 times • Run 0 times
Download the 'Birth Number and Intervals' 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

turtles-own [age female monthspreg miscarriagenum birthnum]

to setup
  clear-all
  create-turtles 11 [ setxy random-xcor random-ycor ]
  set postpartum_infertility 8
  set marriage_age 15
  set perc_female_at_birth 49
  set fertility 20
  set runlength 55
  set perc_miscarriage 20
  set life_expectancy 45
  ask turtle 10 [set age -24 set female 1 set monthspreg -1 set birthnum 0]
  ask turtle 9 [set age 0 set female 1 set monthspreg -1 set birthnum 0]
  ask turtle 8 [set age 264 set female 1 set monthspreg -1 set birthnum 0]
  ask turtle 7 [set age 192 set female 1 set monthspreg -1 set birthnum 0]
  ask turtle 5 [set age 192 set female 1 set monthspreg -1 set birthnum 0]
  ask turtle 6 [set age 168 set female 1 set monthspreg -1 set birthnum 0]
  ask turtle 0 [set age 192 set female 1 set monthspreg -1 set birthnum 0]
  ask turtle 1 [set age 216 set female 1 set monthspreg -1 set birthnum 0]
  ask turtle 2 [set age 240 set female 1 set monthspreg -1 set birthnum 0]
  ask turtle 3 [set age 264 set female 1 set monthspreg -1 set birthnum 0]
  ask turtle 4 [set age 288 set female 1 set monthspreg -1 set birthnum 4]
  reset-ticks
end 

to go
  tick
  if ticks >= (runlength * 12) [ stop ]
  ask turtles [increment-age]
  ask turtles [increment-monthspreg]
  ask turtles [conceive]
  ask turtles [miscarry]
  ask turtles [birth]
  ask turtles [dopostpartum]
  ask turtles [check-death]
                 ;; increase the tick counter by 1 each time through
end 

to increment-age
  set age (1 + age)
end 

to increment-monthspreg
  if monthspreg > -1 [
      set monthspreg (1 + monthspreg)]
end 

to conceive
    if random 100 <= fertility and monthspreg = -1 and female = 1 and age >= (marriage_age * 12 ) and age <= 540 ; 15-45
      [set monthspreg 0  ]
end 

to miscarry
    if random 100 < perc_miscarriage and monthspreg = 5 and female = 1
    [set monthspreg -1 set miscarriagenum (1 + miscarriagenum)]
end 

to birth
  if monthspreg = 9 and female = 1 and random 100 >= infant_mortality [
    hatch 1 [
      set birthnum (1 + birthnum)
      set age 0
      setxy random-xcor random-ycor
      ifelse random 100 < perc_female_at_birth [set female 1] [set female 0]]
    ]
end 

to dopostpartum
  if monthspreg = 9 + postpartum_infertility
  [set monthspreg -1]
end 

to check-death
    if age = (life_expectancy / 12) [ die ] ;; Dies once they hit life expectancy
end 

There is only one version of this model, created about 6 years ago by Stephen Cranney.

Attached files

File Type Description Last updated
Birth Number and Intervals.png preview Preview for 'Birth Number and Intervals' about 6 years ago, by Stephen Cranney Download

This model does not have any ancestors.

This model does not have any descendants.