Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple population simulator for analyzing the effects of China's 1-child policy. Populations are grouped into ages with a bin size of 20 years, and the simulation runs 20 years per tick. At the end of running, it produces a simple population vs. time line chart to display the effects over time.

Simulation assumptions:

  • No family can have more children than childPolicyNum
  • If childPolicyNum is greater than 1, not all families have the max amount of children, they instead have a random amount of kids within the bounds of 1 and childPolicyNum
  • Not all people aged 20-40 ever have kids, this is controlled with the percentHavingChildren variable
  • Death rates among different age bins are different, but constant, with
    • moderate death rates for children (0-20) and middle age (40-60)
    • lowest death rates for young adults (20-40)
    • highest death rates for elderly (60-100)
  • There are so few aged older than 100, that they are negligible in the total calculation, thus it is assumed that no one lives past age 100
  • Male and female birth rates and death rates are equal (since it is always assumed that half of every population is half men and half women)

Requirements

  • python3
  • npm

Setup

npm install

Running

node app.js

About

Simple population simulation in JavaScript

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages