Kandaswamy_Subu_Immigration_Final

No preview image

1 collaborator

Default-person Subu Kandaswamy (Author)

Tags

(This model has yet to be categorized with any tags)
Child of model Immigration_almost_final
Model group EECS 372-Spring 2011 | Visible to everyone | Changeable by the author
Model was written in NetLogo 4.1.2 • Viewed 183 times • Downloaded 8 times • Run 3 times
Download the 'Kandaswamy_Subu_Immigration_Final' 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?

The Immigration agent model is designed to examine the various factors responsible for triggering migration. The model enables us to compare the explanations given by two of the famous economic theories namely Neo Classical economic theory and Keynesian theory . In addition it compares these two established theories with a novel approach of utilizing people_ happiness, measured by Gross National Happiness index as a causal reason for migration. The model can be used to examine the following.

_ rate of immigration based on economical situation, employment rate and Gross National Happiness.

_ Impact of immigration on wage rates and unemployment rate.

_ Impact of population growth on migration rate and wage rate.

HOW IT WORKS

You can test the three economic theories supported by the model in isolation. Set the initial population and ideal percentages.

_ Go-wage will set the mode of the model to simulate wage based immigration.

_ Go-empl will set the mode of the model to simulate employment opportunity based immigration.

_ Go-gnh will set the mode of the model to simulate Gross National Happiness (GNH) based immigration.

The turtles will migrate based on the mode. In wage-based immigration mode, a turtle will decide to migrate if it finds out about better wage in a different country. In employment mode, unemployed turtles migrate to places that have jobs. In GNH mode the turtle will go to a country which has better GNH index than its home.

you can also control factors such as birth rate, awareness, kind of profession ( population dependent / independent),etc.

HOW TO USE IT

Set the following sliders before starting the simulation

Population-x - Initial population of the four countries ( x is 1,2,3 and 4)

Ideal-X-perc - Indicates Ideal percentage of professionals with skill set X for a utopian equilibrium. ( X can take A, B, C and D )

wage-discrepancy - use this slider to set the tolderance of turtle for discrepancy in wage-rates. The turtle will migrate only of the wage difference is higher than the tolerance level.

wage-empl-by-population? - ON implies that the wages are proportional to population size. OFF indicates otherwise.

wage-awareness? - Set to 'on' if you want the turtle to be aware of the other immigrants competing for the same job. Set to 'off' to simulate Gold Rush mode. The turtle would pay no attention to the competition.

gnh-discrepancy - similar to wage-discrepancy but for GNH.

gnh-awareness? - similar to wage-awareness? but for GNH.

birth-rate-on? - Set this if you wanna enable birth and death of turtles based on life-expectancy and birth-rate sliders.

life-expectancy-X - sets the life expectancy of a turtle which was born on Country X ( X can take 1,2,3 and 4 )

birth-rate-X - sets the birth rate of Country X based on which new turtles will be created for every ticks ( X can take 1,2,3 and 4 )

Once setting up all the above. Do the following

SETUP - sets the countries ready with initial population

go-empl - unemployment induced immigration ( Keynesian Theory)

go-wage - Wage based immigration ( Neo classical theory )

go-GNH - Gross National Happiness based immigration

THINGS TO NOTICE

_ Observe how the turtles migrate over time.

_ Observe the Wage-1A plot to undrestand the change in wage-rate for various settings.

_ Observe the Population plot to see how a given immigration strategy would affect the population.

_ Observe the GNH plot to see how GNH value changes over time.

_ Observe the monitors to see how every country strives to achieve equilibrium ( ideal percentages)

THINGS TO TRY

_ Modify various settings to see what kind of immigration strategy would help achieve economic equilibrium faster.

EXTENDING THE MODEL

_ Add immigration control. Every country should allow only a certain number of immigrants.

_ Add technological advancement factor which would reduce the necessity for manual labor thereby increasing unemployment.

NETLOGO FEATURES

This section could point out any especially interesting or unusual features of NetLogo that the model makes use of, particularly in the Procedures tab. It might also point out places where workarounds were needed because of missing features.

RELATED MODELS

This section could give the names of models in the NetLogo Models Library or elsewhere which are of related interest.

CREDITS AND REFERENCES

This section could contain a reference to the model's URL on the web if it has one, as well as any other necessary credits or references.

Comments and Questions

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

Click to Run Model

;; EECS 472 FINAL PROJECT 
;; Agent Model for examining theories of International Migration
;; Balasubramanian 'Subu' Kandaswamy


;;::::::::::::::::::::::::::::::::::::::::::::::GLOBAL DECLARATIONS::::::::::::::::::::::::::::::::::::::::::::::::::::
;;Patches
patches-own [ country ]
;;Turtles
turtles-own [ origin citizen prof employed life]
;;Global Variables
globals [
  ;;countries
  countries
  ;;professions
  profes
  ;;patches for countries
  patches-1 patches-2 patches-3 patches-4
  ;;wages  
  wage-1A wage-1B wage-1C wage-1D
  wage-2A wage-2B wage-2C wage-2D
  wage-3A wage-3B wage-3C wage-3D
  wage-4A wage-4B wage-4C wage-4D
  ;; gross national happiness index
  gnh-1 gnh-2 gnh-3 gnh-4
]

;;::::::::::::::::::::::::::::::::::::::::::::::SETUP AND GO::::::::::::::::::::::::::::::::::::::::::::::::::::

to setup
  set countries [ 1 2 3 4 ]
  set profes [ "A" "B" "C" "D" ]
  setup-patches
  setup-labels
  setup-globals
  setup-turtles
  calc-wage
  calc-gnh
  set-color-by-prof
  do-plot
end 

;;wage-based-immigration

to go-wage
  immigrate-by-wage
  calc-wage
  set-color-by-prof
  tick
  if birth-rate-on?
  [ do-birth
    do-death
  ]
  do-plot
end 

;;GNH based immigration

to go-gnh
  immigrate-by-gnh
  calc-gnh
  calc-wage
  set-color-by-prof
  tick
  if birth-rate-on?
  [ do-birth
    do-death
  ]
  do-plot
end 

;; Employment based immigration

to go-employment
  immigrate-by-employment
  calc-wage
  set-color-by-prof
  tick
  if birth-rate-on?
  [ do-birth
    do-death
  ]
  do-plot
end 

to setup-patches
  clear-all
  set-default-shape turtles "person"
  set patches-1 patches with [pycor > 0 and pxcor < 0]
  ask patches-1
  [ set pcolor green 
    set country 1
    ]
  set patches-2 patches with [pycor > 0 and pxcor > 0]
  ask patches-2
  [ set pcolor blue 
    set country 2]
  set patches-3 patches with [pycor < 0 and pxcor < 0]
  ask patches-3
  [ set pcolor orange 
    set country 3]
  set patches-4 patches with [pycor < 0 and pxcor > 0]
  ask patches-4
  [ set pcolor magenta 
    set country 4]
end 

to setup-labels
  ask patch (min-pxcor / 2) (max-pycor / 2 ) [
    set plabel "Country 1"
  ]
  ask patch (max-pxcor / 2) (max-pycor / 2 ) [
    set plabel "Country 2"
  ]
  ask patch (min-pxcor / 2) (min-pycor / 2 ) [
    set plabel "Country 3"
  ]
  ask patch (max-pxcor / 2) (min-pycor / 2 ) [
    set plabel "Country 4"
  ]
end 

to setup-globals
  set gnh-1 50
  set gnh-2 50
  set gnh-3 50
  set gnh-4 50
end 

to setup-turtles
  crt population-1 [
    set citizen 1
    set origin 1
    set prof one-of [ "A" "B" "C" "D" ]
    set employed false
    set life life-expectancy-1
    move-to-empty-one-of patches-1
    ]
  crt population-2 [
    set citizen 2
    set origin 2
    set prof one-of [ "A" "B" "C" "D" ]
    set employed false
    set life life-expectancy-2
    move-to-empty-one-of patches-2
  ]
  crt population-3 [
    set citizen 3
    set origin 3
    set prof one-of [ "A" "B" "C" "D" ]
    set employed false
    set life life-expectancy-3
    move-to-empty-one-of patches-3
  ]
  crt population-4 [
    set citizen 4
    set origin 4
    set prof one-of [ "A" "B" "C" "D" ]
    set employed false
    set life life-expectancy-4
    move-to-empty-one-of patches-4
  ]
end 

to set-color-by-prof
  ask turtles [
    ifelse employed = false
    [ set color red ]
    [ if prof = "A" [ set color green ]
      if prof = "B" [ set color blue ]
      if prof = "C" [ set color yellow ]
      if prof = "D" [ set color grey]
    ]
  ]
end 

;;::::::::::::::::::::::::::::::::::::::::::::::IMMIGRATIUON PROCEDURES::::::::::::::::::::::::::::::::::::::::::::::::::::

to immigrate-by-wage
    ask turtles [
      let max-wage-desc wage-discrepancy
      let max-wage-country 0
      let max-wage-country-list (list 0)
      let curwage (get-wage citizen prof)
      ;; Find country which has better wage
      foreach [ 1 2 3 4 ]
      [
        if citizen != ? and (get-wage ? prof) > curwage [
          let twage-desc calc-wage-desc prof citizen ?
          if max-wage-desc <= twage-desc
            [
              set max-wage-desc twage-desc
              set max-wage-country-list lput ? max-wage-country-list
            ] 
        ]
      ]
      set max-wage-country-list but-first max-wage-country-list
      if length max-wage-country-list > 0 [
        set max-wage-country one-of max-wage-country-list
      ]
      ;; move to that country
      if max-wage-country != 0
      [
        move-to-empty-one-of patches with [ country = max-wage-country ]
        set citizen max-wage-country
        set employed false
        if wage-awareness? = true
        [ ifelse wage-empl-by-population? 
          [set-wage citizen prof (calc-wage-for citizen prof) ]
          [set-wage citizen prof (calc-wage-for-common citizen prof) ]       
        ]
      ]
    ]
end 

to immigrate-by-gnh
    ask turtles [
      let max-gnh gnh-discrepancy
      let max-gnh-country 0
      let max-gnh-country-list (list 0)
      let curgnh (get-gnh citizen)
      ;; Find country which has better GNH
      foreach [ 1 2 3 4 ]
      [
        let tgnh (get-gnh ?)
        if citizen != ? and tgnh > curgnh [
          if max-gnh <= (tgnh - curgnh)
            [
              set max-gnh (tgnh - curgnh)
              set max-gnh-country-list lput ? max-gnh-country-list
            ] 
        ]
      ]
      set max-gnh-country-list but-first max-gnh-country-list
      if length max-gnh-country-list > 0 [
        set max-gnh-country one-of max-gnh-country-list
      ]
      ;;Move to that Country
      if max-gnh-country != 0
      [
        move-to-empty-one-of patches with [ country = max-gnh-country ]
        set citizen max-gnh-country
        set employed false
        if wage-awareness? = true
        [ ifelse wage-empl-by-population? 
          [set-wage citizen prof (calc-wage-for citizen prof) ]
          [set-wage citizen prof (calc-wage-for-common citizen prof) ]       
        ]
        if gnh-awareness? = true
        [ ifelse wage-empl-by-population? 
          [set-wage citizen prof (calc-wage-for citizen prof) ]
          [set-wage citizen prof (calc-wage-for-common citizen prof) ] 
          set-gnh citizen (calc-gnh-for citizen) ]
      ]
    ]
end 

to immigrate-by-employment
    ask turtles with [employed = false ] [
      let max-job-avail (calc-job-avail prof citizen)
      let max-job-country 0
      let max-job-country-list (list 0)
      ;; Find country which has better Employment opportunities
      foreach [ 1 2 3 4 ]
      [
        let tjob-avail calc-job-avail prof ?
        if citizen != ? [
           if max-job-avail < tjob-avail
           [
             set max-job-avail tjob-avail
             set max-job-country-list lput ? max-job-country-list
           ] 
        ]
      ]
      set max-job-country-list but-first max-job-country-list
      if length max-job-country-list > 0 [
        set max-job-country one-of max-job-country-list
      ]
      ;; Move to that country
      if max-job-country != 0
      [
        move-to-empty-one-of patches with [ country = max-job-country ]
        set citizen max-job-country
        set employed false
        if wage-awareness? = true
        [ ifelse wage-empl-by-population? 
          [set-wage citizen prof (calc-wage-for citizen prof) ]
          [set-wage citizen prof (calc-wage-for-common citizen prof) ]       
        ]      
      ]
    ]
end 

;;::::::::::::::::::::::::::::::::::::::::::::::CALCULATION UTILS::::::::::::::::::::::::::::::::::::::::::::::::::::

to calc-wage
  ifelse wage-empl-by-population? [
    foreach [ 1 2 3 4 ]
    [
      set-wage ? "A" (calc-wage-for ? "A")
      set-wage ? "B" (calc-wage-for ? "B")
      set-wage ? "C" (calc-wage-for ? "C")
      set-wage ? "D" (calc-wage-for ? "D")
    ]
  ]
  [
    foreach [ 1 2 3 4 ]
    [
      set-wage ? "A" (calc-wage-for-common ? "A")
      set-wage ? "B" (calc-wage-for-common ? "B")
      set-wage ? "C" (calc-wage-for-common ? "C")
      set-wage ? "D" (calc-wage-for-common ? "D")
    ]
  ]
end 

to calc-gnh
      foreach [ 1 2 3 4 ]
    [ set-gnh ? (calc-gnh-for ?) ]
end 

to-report calc-gnh-for [ state ]
  let le-desc 0
  let mp-desc 0
  let ai-desc 0
  let ue-desc 0
  set le-desc ((get-life-expectancy state) / (get-max-life-expectancy)) * 10
  set mp-desc 10 - (((get-population state) / (get-max-population)) * 10)
  set ai-desc ((get-average-income state) / (get-max-avg-income)) * 10
  set ue-desc 10 - (((get-unempl state) / (get-max-unempl)) * 10)
  report (le-desc + mp-desc + ai-desc + ue-desc)
end 

to   do-death
  ask turtles [
    set life life - 1
    if life <= 0
    [ die ]
  ]
end 

to-report calc-job-avail [profs state]
  let tot-profs count turtles with [ citizen = state and prof = profs ]
  let ideal-profs (get-ideal profs)
  ifelse ideal-profs > tot-profs
  [report  ideal-profs - tot-profs]
  [report 0]
end 

to-report calc-wage-desc [ profs state nstate ]
let result 0
if (get-wage state profs) != 0 [
  set result (((get-wage nstate profs) - (get-wage state profs)) / (get-wage state profs)) * 100
]
report result
end 

to-report calc-wage-for [ state profs ]
  let pop count turtles with [ citizen = state ]
  let prof-pop count turtles with [ citizen = state and prof = profs ]
  let ideal-prof floor (pop * (get-ideal profs)) / 100
  let totinv ideal-prof * 50
  ask turtles with [ citizen = state and prof = profs ]
    [ set employed false ]
  ifelse ideal-prof < prof-pop
  [ ask n-of ideal-prof turtles with [ citizen = state and prof = profs ]
    [ set employed true ]
  ]
  [ ask turtles with [ citizen = state and prof = profs ]
    [ set employed true ]
  ]
  ifelse prof-pop = 0
  [report totinv]
  [report totinv / prof-pop]
end 

to-report calc-wage-for-common [ state profs ]
  let pop count turtles with [ citizen = state ]
  let prof-pop count turtles with [ citizen = state and prof = profs ]
  let ideal-prof floor (pop * (get-ideal profs)) / 100
  let totinv (get-ideal profs) * 50
  ask turtles with [ citizen = state and prof = profs ]
    [ set employed false ]
  ifelse ideal-prof < prof-pop
  [ ask n-of ideal-prof turtles with [ citizen = state and prof = profs ]
    [ set employed true ]
  ]
  [ ask turtles with [ citizen = state and prof = profs ]
    [ set employed true ]
  ]
  ifelse prof-pop = 0
  [report totinv]
  [report totinv / prof-pop]
end 

to move-to-empty-one-of [locations]  ;; turtle procedure
  move-to one-of locations
  while [any? other turtles-here] [
    move-to one-of locations
  ]
end 

to do-birth
  if ticks mod 5 = 0
  [
    crt  birth-rate-1[
      set citizen 1
      set origin 1
      set prof one-of [ "A" "B" "C" "D" ]
      set employed false
      set life life-expectancy-1
      move-to-empty-one-of patches-1
    ]
    crt birth-rate-2 [
      set citizen 2
      set origin 2
      set prof one-of [ "A" "B" "C" "D" ]
      set employed false
      set life life-expectancy-2
      move-to-empty-one-of patches-2
    ]
    crt birth-rate-3 [
      set citizen 3
      set origin 3
      set prof one-of [ "A" "B" "C" "D" ]
      set employed false
      set life life-expectancy-3
      move-to-empty-one-of patches-3
    ]
    crt birth-rate-4 [
      set citizen 4
      set origin 4
      set prof one-of [ "A" "B" "C" "D" ]
      set employed false
      set life life-expectancy-4
      move-to-empty-one-of patches-4
    ]]
end 

;;::::::::::::::::::::::::::::::::::::::::::::::PLOTS::::::::::::::::::::::::::::::::::::::::::::::::::::

to do-plot
  do-plot-population
  do-plot-gnh
  do-plot-wage
end 

to do-plot-Population
  set-current-plot "Population"
  set-current-plot-pen "country-1"
  plot count turtles with [ citizen = 1 ]      
  set-current-plot-pen "country-2"
  plot count turtles with [ citizen = 2 ]
  set-current-plot-pen "country-3"
  plot count turtles with [ citizen = 3 ]      
  set-current-plot-pen "country-4"
  plot count turtles with [ citizen = 4 ]            
end 

to do-plot-gnh
  set-current-plot "Gross National Happiness"
  set-current-plot-pen "gnh-1"
  plot gnh-1   
  set-current-plot-pen "gnh-2"
  plot gnh-2
  set-current-plot-pen "gnh-3"
  plot gnh-3     
  set-current-plot-pen "gnh-4"
  plot gnh-4           
end 

to do-plot-wage
  set-current-plot "wage-A"
  set-current-plot-pen "wage-1A"
  plot wage-1A 
  set-current-plot-pen "wage-2A"
  plot wage-2A
  set-current-plot-pen "wage-3A"
  plot wage-3A     
  set-current-plot-pen "wage-4A"
  plot wage-4A          
end 

;;::::::::::::::::::::::::::::::::::::::::::::::GETTER/SETTERS AND UTILS::::::::::::::::::::::::::::::::::::::::::::::::::::

to-report get-ideal [ profs ]
  if profs = "A"
  [ report ideal-A-perc ]
  if profs = "B"
  [ report ideal-B-perc ]
  if profs = "C"
  [ report ideal-C-perc ]
  if profs = "D"
  [ report ideal-D-perc ]
end 

to-report get-unempl [state]
  report count turtles with [ citizen = state and employed = false ]
end 

to-report get-gnh [ state ]
  if state = 1 [ report gnh-1 ]
  if state = 2 [ report gnh-2 ]
  if state = 3 [ report gnh-3 ]
  if state = 4 [ report gnh-4 ]
end 

to set-gnh [ state new-gnh ]
  if state = 1 [ set gnh-1 new-gnh ]
  if state = 2 [ set gnh-2 new-gnh ]
  if state = 3 [ set gnh-3 new-gnh ]
  if state = 4 [ set gnh-4 new-gnh ]
end 

to-report get-life-expectancy [ state ]
  if state = 1 [ report life-expectancy-1 ]
  if state = 2 [ report life-expectancy-2 ]
  if state = 3 [ report life-expectancy-3 ]
  if state = 4 [ report life-expectancy-4 ]
end 

to-report get-population [ state ]
  report count turtles with [citizen = state]
end 

to-report get-average-income [ state ]
  let tot-pop get-population state
  let income-A (count turtles with [ citizen = state and prof = "A" ]) * (get-wage state "A")
  let income-B (count turtles with [ citizen = state and prof = "B" ]) * (get-wage state "B")
  let income-C (count turtles with [ citizen = state and prof = "C" ]) * (get-wage state "C")
  let income-D (count turtles with [ citizen = state and prof = "D" ]) * (get-wage state "D")
  ifelse tot-pop != 0
  [ report ((income-A + income-B + income-C + income-D) / tot-pop) ]
  [ report 0 ]
end 

to-report get-max-life-expectancy
  let max-exp 0
  foreach [ 1 2 3 4]
  [
    if (get-life-expectancy ?) > max-exp
    [ set max-exp (get-life-expectancy ?) ]
  ]
  report max-exp
end 

to-report get-max-population
  let max-pop 0
  foreach [ 1 2 3 4]
  [
    if (get-population ?) > max-pop
    [ set max-pop (get-population ?) ]
  ]
  report max-pop
end 

to-report get-max-avg-income
  let max-avg-income 0
  foreach [ 1 2 3 4]
  [
    if (get-average-income ?) > max-avg-income
    [ set max-avg-income (get-average-income ?) ]
  ]
  report max-avg-income
end 

to-report get-max-unempl
  let max-unempl 0
  foreach [ 1 2 3 4]
  [
    if (get-unempl ?) > max-unempl
    [ set max-unempl (get-unempl ?) ]
  ]
  report max-unempl
end 

to-report get-wage [ state profs ]
  if state = 1 [
    if profs = "A" [ report wage-1A ]
    if profs = "B" [ report wage-1B ]
    if profs = "C" [ report wage-1C ]
    if profs = "D" [ report wage-1D ]
  ]
  if state = 2 [
    if profs = "A" [ report wage-2A ]
    if profs = "B" [ report wage-2B ]
    if profs = "C" [ report wage-2C ]
    if profs = "D" [ report wage-2D ]
  ]
  if state = 3 [
    if profs = "A" [ report wage-3A ]
    if profs = "B" [ report wage-3B ]
    if profs = "C" [ report wage-3C ]
    if profs = "D" [ report wage-3D ]
  ]
  if state = 4 [
    if profs = "A" [ report wage-4A ]
    if profs = "B" [ report wage-4B ]
    if profs = "C" [ report wage-4C ]
    if profs = "D" [ report wage-4D ]
  ]
end 

to set-wage [ state profs new-wage]
  if state = 1 [
    if profs = "A" [ set wage-1A new-wage]
    if profs = "B" [ set wage-1B new-wage]
    if profs = "C" [ set wage-1C new-wage]
    if profs = "D" [ set wage-1D new-wage]
  ]
  if state = 2 [
    if profs = "A" [ set wage-2A new-wage]
    if profs = "B" [ set wage-2B new-wage]
    if profs = "C" [ set wage-2C new-wage]
    if profs = "D" [ set wage-2D new-wage]
  ]
  if state = 3 [
    if profs = "A" [ set wage-3A new-wage]
    if profs = "B" [ set wage-3B new-wage]
    if profs = "C" [ set wage-3C new-wage]
    if profs = "D" [ set wage-3D new-wage]
  ]
  if state = 4 [
    if profs = "A" [ set wage-4A new-wage]
    if profs = "B" [ set wage-4B new-wage]
    if profs = "C" [ set wage-4C new-wage]
    if profs = "D" [ set wage-4D new-wage]
  ]
end 
  

There is only one version of this model, created over 6 years ago by Subu Kandaswamy.

Attached files

No files

Parent: Immigration_almost_final

This model does not have any descendants.

Graph of models related to 'Kandaswamy_Subu_Immigration_Final'