Initial Setup and Population Reproduction Problem

Initial Setup and Population Reproduction Problem preview image

1 collaborator

Lk Ladislav Kazmer (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.1.0 • Viewed 784 times • Downloaded 48 times • Run 0 times
Download the 'Initial Setup and Population Reproduction Problem' modelDownload this modelEmbed this model

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


WHAT IS IT?

This is the 1st procedure (Initial Setup and Population Reproduction) of the broader 'Social Preferences of Home Ownership Model'. The purpose of the procedure is to simulate population reproduction processes according to: a) Czech population age distribution (data from the Census 2011); b) virtual population with the 'uniform' initial age distribution.

HOW IT WORKS

When model is initialized, turtle's age- and gender characteristics are randomly distributed according to pre-defined population options, selected before the 'setup' button in launched. Turtles gender is distinguished by color. Each year (tick) turtles age by 1 year. All turtles reproduce at the age of 'mean-age-at-childbirth' and die when turtle's 'lifespan' age is reached (representing the population life expectancy by birth, i.e. expected years of life at the age of 0). The gender of the newborn turtle is selected randomly and is defined by the initial gender probability distribution. Turtles live in a homogeneous space (patches) without spatial and temporal limitations.

HOW TO USE IT

Altogether, 4 options are needed to be pre-defined before the model is initialized - population i) age- and ii) gender distribution (% of males), iii) mean age at childbirth (in years), iv) lifespan of turtles (in years).

THINGS TO NOTICE

There is an obvious 'emergent bug' in the model. When model is launched, several fluctuations in the total population number are present, until the 'stationary' population number in reached. This value is dependent on both 1) intial population distribution of agents (mainly % of agents in the age below the 'mean-age-at-childbirth'); 2) initial values of input parameters (lifespan and mean-age-at-childbirth). After the 'stationary population number' is reached, model passes into the periodic phase, in which the total number of agents periodically varies between 2 values.

THINGS TO TRY

The 'emergent bug' is present in both initial age distributions. Although this problem is considerably less significant in the case of 'uniform' one, nor proportional age distribution of agents is unable to 'smooth' periodical swings in the resulting population count generated by the model.

RELATED MODELS

Wilensky, U. (1997). NetLogo AIDS model. http://ccl.northwestern.edu/netlogo/models/AIDS. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL

Wilensky, U. (1998). NetLogo Virus model. http://ccl.northwestern.edu/netlogo/models/Virus. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

Comments and Questions

Any suggestions to solve the BUG with population reproduction... ?

Hi, dear colleagues, has anybody from You challenged some similar problem with "periodic swings" in the total population number as i have described in the model Info-tab ? I will appreciate any suggestions from You. Ladislav

Posted over 10 years ago

Click to Run Model

turtles-own
 [
  age                                     ; how many years (ticks) old the turtle is ?
  male?                                   ; turtle's gender
 ] 

to setup
  clear-all
  setup-turtles
  reset-ticks  
end 

to setup-turtles
  set-default-shape turtles "person"
  create-turtles people
    [ setxy random-pxcor random-pycor
      
      ; IF asked, set the 'uniform' age distrubution as initial one; ELSE set the CZE (2011) population age distribution
      ifelse ( age-distribution = "uniform" )
      [ set age random 100 ]
      [
      ; Set the age distribution of agents following the Czech Population Census (2011) 5yrs age-group data: 
      let coinA random-float 100
      let coinB random 5
        ifelse (coinA < 4.8 )
              [ set age coinB ][ 
        ifelse (coinA < 9.5 )
              [ set age (coinB + 5) ][
        ifelse (coinA < 14.3 )
              [ set age (coinB + 10) ][
        ifelse (coinA < 19.9 )
              [ set age (coinB + 15) ][
        ifelse (coinA < 26.3 )
              [ set age (coinB + 20) ][
        ifelse (coinA < 33.2 )
              [ set age (coinB + 25) ][
        ifelse (coinA < 41.6 )
              [ set age (coinB + 30) ][
        ifelse (coinA < 50.1 )
              [ set age (coinB + 35) ][
        ifelse (coinA < 56.8 )
              [ set age (coinB + 40) ][
        ifelse (coinA < 63.5 )
              [ set age (coinB + 45) ][
        ifelse (coinA < 69.8 )
              [ set age (coinB + 50) ][
        ifelse (coinA < 77.0 )
              [ set age (coinB + 55) ][
        ifelse (coinA < 84.2 )
              [ set age (coinB + 60) ][
        ifelse (coinA < 89.6 )
              [ set age (coinB + 65) ][
        ifelse (coinA < 93.3 )
              [ set age (coinB + 70) ][
        ifelse (coinA < 96.5 )
              [ set age (coinB + 75) ][
        ifelse (coinA < 98.5 )
              [ set age (coinB + 80) ][
        ifelse (coinA < 99.7 )
              [ set age (coinB + 85) ]
              [ set age (coinB + 90) ]
              ]]]]]]]]]]]]]]]]]
      ]                               ; end of 'set turtles age distribution' procedures
      
      ; Set turtles gender distribution and corresponding color:
      let coinC random 100 
        ifelse (coinC < %males )
              [ set male? true set color blue ]
              [ set male? false set color red  ]
      
      ; Set turtles size
      set size 1
     ]
end 

;;;
;;; GO PROCEDURES
;;;

to go
   ask turtles [ 
   move                               ; turtles move randomly within their world
   get-older                          ; turtles age every tick (year)
     if ( reproduce? ) [ reproduce ]  ; turtles reproduce in the given age
   ]                                  ; end of 'go' procedures 
   tick
end 


; Turtles move randomly from one patch to another:

to move                               ; turtle procedure
   rt random-float 360
   forward 1
end 


; Turtles get older each year (tick) by one year

to get-older                          ; turtle procedure
   ifelse ( die? )                    ; if turtle reaches the given age, it dies
   [ die ]
   [ set age ( age + 1 ) ]
end 

to-report die?                        ; turtle dies at the age of 'lifespan'
report ( age >= lifespan )
end 


; All turtles reproduce as they reach the given age:

to reproduce
   let coinD random-float 1
   hatch 1 [                          
     ifelse ( coinD < %males / 100 )             ; new turtle 'gender' probability by birth (defined by initial global variable before the 'setup')
     [ set age 0 set male? true set color blue ]
     [ set age 0 set male? false set color red ] 
  ]
end 

to-report reproduce?                  ; turtle reproduces at the age of 'mean age at childbirth'
report age = mean-age-at-childbirth
end 


;;;
;;; MONITOR PROCEDURES
;;;

; All monitors are defined on the Interface tab

There are 3 versions of this model.

Uploaded by When Description Download
Ladislav Kazmer over 10 years ago Model description included Download this version
Ladislav Kazmer over 10 years ago Model description included Download this version
Ladislav Kazmer over 10 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Initial Setup and Population Reproduction Problem.png preview "Reproduction Bug" over 10 years ago, by Ladislav Kazmer Download
Initial Setup and Population Reproduction Problem.png preview "Reproduction Bug" over 10 years ago, by Ladislav Kazmer Download

This model does not have any ancestors.

This model does not have any descendants.