Population Dynamics

Population Dynamics preview image

2 collaborators

Default-person Hossein Sabzian (Author)
Nima Shahriari (Team member)

Tags

population dynamics 

Tagged by Hossein Sabzian over 1 year ago

Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.2.0 • Viewed 392 times • Downloaded 22 times • Run 0 times
Download the 'Population Dynamics' 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 model is designed to explain the dynamics of population in social system.

HOW IT WORKS

In this simulation model, there exists a population of N agents, each classified as either male or female. Initially, all agents are single and denoted by a magenta color. As they reach 18 years of age (three ticks representing one year), each single agent embarks on a quest to find a suitable opposite-sex partner for marriage. Upon marriage, the male agent's color transforms to blue, while the female agent's color changes to orange. To qualify for marriage, an agent must be at least 18 years old. A married female agent has the capability to give birth to a child within the age range of min-age-of-reproduction to max-age-of-reproduction. Once a married female's age surpasses the max-age-of-reproduction, she becomes incapable of bearing additional children. The birth of a child incurs a cost of 20 units of energy from the mother and is subject to the parameter of probability-of-birth.

While traversing the landscape in search of food, agents expend energy based on the parameters of energy-lost-for-moving and energy-lost-for-finding-food. Consuming food replenishes their energy, determined by the parameter of energy-gained-from-eating. Agents facing energy levels equal to or below zero immediately succumb to death.

The food that agents consume regrows from the ground, and its renewal is governed by the parameter-of-regrowth. Under normal circumstances, an agent can live up to 100 years without encountering significant issues. However, there are three conditions that may pose serious threats to an agent's survival:

  1. Vehicle Crashes: If an agent owns a vehicle, a high-speed crash carries an 80% probability of resulting in death, while a low-speed crash has a 10% fatality probability.

  2. Energy Depletion: An agent facing complete energy loss without finding food will experience immediate death.

  3. Parasitic Infection: In instances of societal overpopulation, exceeding a critical threshold, agents are at risk of parasitic infection. Infected agents age three times faster than their uninfected counterparts, leading to potential adverse consequences.

HOW TO USE IT

(how to use the model, including a description of each of the items in the Interface tab)

Paramater of "initial-pop" stands for number of agents (persons)

Parameter of "percentage-of-vehicle-owner" stands for number of agents having a vehicle

Parameter of "min-age-of-reproduction" stands for minimum age of a married female agent that can get pregnant

Parameter of "ticks-as-a-year" stands for how many ticks correspond to a year

Parameter of "max-age-of-reproduction" stands for maximum age of a married female agent that can get pregnant.

Parameter of " probability-of-childbearing" stands for how likely a married agent can get pregnant and give birth to a child.

Parameter of "possibility-of-vehicle-crash" stands for how likely a vehicle owner can have a crash.

Parameter of "High-speed-crash" is a switch that when it is ON a car owner will have a high-speed-crash (death probability of 80%) and when it is Off a car owner will have a lowe-speed crash (death probability of 10%).

Parameter of "critical threshold" stands fro a value that when the number of population exceed it. The society will get overcrowded and a skin parasite will spread through the society and infect 5% of people in each tick.

Parameter of "energy-lost-for-finding-food " stands for how much energy an agent loses when it searches to find food.

Parameter of "energy-lost-for-moving " stands for how much energy an agent loses when it searches to move over landscape

Parameter of "energy-gained-for-eating" stands for how much energy an agent gaines when it eats food.

Parameter of "probability-of-regrowth" stands for how likely a food can re-grow from the ground.

THINGS TO NOTICE

A clear path-dependecy is visible. Actually, When the population grows, the agents gradually convege to a specific place and they increase and decrease in number there.

THINGS TO TRY

Try the model for different values of critical threshold when model is running.

Try the model for when the world can wrap verticall or horizontally or both of them ans see whether there will be a patch-dependency for population concentration.

EXTENDING THE MODEL

A year is accounted for by three ticks and it can be parametrised by a slider

The age for marriage is 18 (for both males and females) and it can be parametrised by a slider.

When a married female agent gives birth to a child, it loses 20 units of energy.This number can be parametrised via a slider.

After over-population, the number of agents that get parasite-infected in each tick is fixed (5%) and can be parametrised by a slider.

The death probability of agents with high-speed-crash(80%)is fixed and can be parametrised by a slider.

The death probability of agents with low-speed-crash (10%) is fixed and can be parametrised by a slider.

RELATED MODELS

Predator-prey Model

CREDITS AND REFERENCES

(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

patches-own [food]

turtles-own [
 gender ;;  male or female
 married?  ;; the maritial status of the agent
 spouse  ;; the spouse of the agent if it is married
 age ;; the age of agent with maximum of 100
 vehicle? ;; it is true if the agent has a wehicle and false if the agent has no vehicle
 parasite? ;; when the population exceeds the critical threshold, 0.1 of them get infected with parasite
 energy  ;; the energy of the agent
]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;setup block

to setup
  ca
  random-seed my-seed

  ask patches [
    set food random 10
    recolor-patch
  ]
  crt initial-pop [
    initial-properties
    setxy random-xcor random-ycor
  ]

  reset-ticks
end 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Go block

to go
  if not any? turtles [stop]
  if ticks = stop-time [stop]

ask turtles [
    update-age
    eat
  ]


ask turtles with [ age >= 18 and not married? ] [
    move
    evaluation-for-marriage ;; it assess the other agents on  when it can marry or not
  ]

ask turtles with [ married? ] [
    reproduction
  ]

death-by-energy-loss ;; death by loss of energy
unexpected-events  ;;  unexpcted events like car accidents, airplane crashes
unexpected-illness ;; unexpcted illnesses like cancers, HIV and parasite spreading



ask turtles with [parasite?] [set age age + random 4 ]


ask patches [ regrowth  recolor-patch ]



  tick
end 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; helper procedures
;;;;;;;;;;;;;;;;;;a patch-procedure

to recolor-patch
  set pcolor scale-color green food 10 0
end 
;;;;;;;;;;;;;;;;;; a turtle-procedure

to initial-properties
set size 2
set color magenta
set spouse nobody
set married? false
set age 0
set parasite? false
set energy 100
ifelse random-float 1.0 <= percentage-of-vehicle-owners [ set vehicle? true] [set vehicle? false]
ifelse random-float 1.0 <= 0.5 [set gender "male" set shape "person"] [ set gender "female" set shape "woman"]
end 
;;;;;;;;;;;;;;;;;; a turtles procedure

to update-age
  if ticks mod ticks-as-a-year = 0 [set age age + 1 ]
  if age >= 100 [ get-dead ]
end 

to get-dead
if spouse != nobody [ask spouse [ set spouse nobody set married? false ] ]
die
end 

;;;;;;;;;;;;;;;;;;a turtle procedure

to eat
  let target one-of patches with [food >= 1]
  set energy energy - energy-lost-for-finding-food
  if target != nobody [
    ask target [ set food food - 1 ]
    set energy energy + energy-gained-from-eating
  ]
end 
;;;;;;;;;;;;;;;;;;;;;;a turtle procedure

to move
  rt random-float 90
 lt random-float 90
  if not can-move? 1 [ rt 180]
  fd 0.75
  set energy energy - energy-lost-from-moving
end 
;;;;;;;;;;;;;;;;;;;;;; turtle procedure of marriage mechanisms

to evaluation-for-marriage
  let marriage-target one-of other turtles-here with [gender != [gender] of myself]  ;; target for marriage

  if  marriage-target != nobody and [age] of marriage-target >= 18 [

  let hypothesis? [married?] of marriage-target = true ;; a hypothesis that the target is married

    ifelse hypothesis? [ move ] [ marry marriage-target]

  ]
end 

to marry [person]
   set married? true set spouse person set-color
   ask person [set married? true set spouse myself set-color ]
end 

to set-color
  set color ifelse-value (gender = "male") [blue] [orange] ;; married man & woman
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;a turtle procedure

to reproduction
  if  gender = "female" and married? and age >= min-age-of-reproduction and age <= max-age-of-reproduction [
    if random-float 1.0 <= probability-of-childbearing [set energy energy - 20 hatch 1 [
    initial-properties

  ]  ]   ]
end 
;;;;;;;;;;;;;;;;;;;;;;;;;;; trurtle procedures for death by energy loss, unexpcted events and unexpected illness

to death-by-energy-loss
  ask turtles [ if energy <= 0 [ get-dead]  ]
end 

to unexpected-events
  ;; for car accident
  ask turtles [if age >= 18 and vehicle?
                      [ if possibility-of-vehicle-accident?
                                      [ ifelse high-speed-crash?  [ if random-float 1.0 <= 0.8 [get-dead]]   [if random-float 1.0 <= 0.1 [get-dead] ]  ] ] ]
end 

to unexpected-illness
  ;; for parasite spread
  if count turtles >= critical-threshold [ ask n-of (0.05 * count turtles) turtles [ set parasite? true] ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;; a trurtle procedure

to regrowth
  if random-float 1.0 <= probability-of-regrowth [ if food <= 1 [set food food + random 10] ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; reporters

to-report married-people
  report count turtles with [ married?]
end 

to-report single-people
  report count turtles with [not married?]
end 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; shocks

to shock-for-single-agents  ;; unmaried agents
  ask turtles with [ not married? ] [ move-to one-of patches]
end 

to shock-for-all-agents
  ask turtles  [ move-to one-of patches]
end 

;;;;;;;;;;; The voluem of food

to-report north-east
  report sum [food] of patches with [ pxcor > 0 and pycor > 0 ]
end 

to-report north-west
  report sum [food] of patches with [ pxcor < 0 and pycor > 0 ]
end 

to-report south-east
  report sum [food] of patches with [ pxcor > 0 and pycor < 0 ]
end 

to-report south-west
  report sum [food] of patches with [ pxcor < 0 and pycor < 0 ]
end 

There is only one version of this model, created over 1 year ago by Hossein Sabzian.

Attached files

File Type Description Last updated
Population Dynamics.png preview Preview for 'Population Dynamics' over 1 year ago, by Hossein Sabzian Download

This model does not have any ancestors.

This model does not have any descendants.