Giacomo Pennazio

Simulation models for economics

Project work on

"Rural-urban migration."

 

The applet requires Java 1.4.1 or higher. It will not run on Windows 95 or Mac OS 8 or 9. Mac users must have OS X 10.2.6 or higher and use a browser that supports Java 1.4. (Safari works, IE does not. Mac OS X comes with Safari. Open Safari and set it as your default web browser under Safari/Preferences/General.) On other operating systems, you may obtain the latest Java plugin from Sun's Java site.


An introduction to Rural-urban migration application.


powered by NetLogo

view/download model file: rural-urban_migration.nlogo


PROCEDURES

patches-own [output 
  inhabitants]
turtles-own [n-of-neighbours 
  turtles-on-my-patch
   friend
  income]
to setup
  ca
  crt 200
  ask turtles 
           [setxy random-xcor random-ycor]
  ask patches 
           [set pcolor green
            if pxcor < ( -2) and pycor < (-2) 
            [set pcolor blue]
            if pxcor < (- 4) and pycor < (- 4)
             [set pcolor red]]
     
  ask turtles 
       [ifelse normal? = true 
    [ if pcolor = red
     [set income random-normal income-from-city 10]
   if  pcolor = green 
   [set income random-normal income-from-land 10]]
    [if pcolor = red [set income random income-from-city]
       if pcolor = green [set income random income-from-land]]]
   ask turtles [set friend one-of turtles in-radius 3]         
         
         
end

 

to go
  ask turtles            
  [set n-of-neighbours count turtles-on neighbors
    set turtles-on-my-patch count turtles-here]
    ask patches [set inhabitants count turtles-here] 
    tick 
   migration
  reallocation
  
  do-plot   
end

to migration

  
  ask turtles [
               
               if income-from-land > income-from-city and
                  income-from-land > income 
                                   [move-to one-of patches with [pcolor = green]]

               if income-from-land <= income-from-city and
                  income-from-city > income  
                                   [move-to one-of patches with [pcolor = red]]
                ]
 patches-output 
 mimic                 
                                                                  
end 
to patches-output
   
   ask patches [ if patches-output? = true and pcolor != red and inhabitants != 0
     [
    set output (( 3 * inhabitants ^ 1.2) / inhabitants) + constant
    ]
    ]
   
end
to mimic
  ask n-of random 200 turtles [if mimic? = true and friend != self
    [move-to friend]]
end

to reallocation
  ask turtles [
  
   if pcolor = red 
   [city-movements]          
     
    if pcolor = blue 
    [slum-movements]
    
  
     if pcolor = green
    [land-movements]
    
      ]
  
  
end 
to city-movements
  
       if n-of-neighbours  > work-place    
                   [move-to one-of patches with [pcolor = blue ]]
       if turtles-on-my-patch >= 2 
                  [fd 1]  
       if n-of-neighbours <= work-place and turtles-on-my-patch <= 1 
                     [set income 110      
                       move-to patch-here]
end
                   
to slum-movements
  
  ifelse patches-output? = true 
  [ set income output  
   ]
  [set income (income-from-city / turtles-on-my-patch)
        ]
  if income < income-from-land [move-to one-of patches with [pcolor = green]]
  move-to patch-here  
end

to land-movements
 ifelse patches-output? = true [ set income output ]
 [ ifelse normal? = true 
    [set income random-normal income-from-land 10]
    
    [set income random income-from-land]]
end
    
to do-plot
  set-current-plot "movements"
  set-current-plot-pen "citizens"
  plot count turtles-on patches with [pcolor = red]
  set-current-plot-pen "farmers"
  plot count turtles-on patches with [pcolor = green]
  set-current-plot-pen "underemployed"
  plot count turtles-on patches with [pcolor = blue ]
end