Luca Rebuffi Alessandro Sasso

Simulation models for economics

Project work on

"Education, income and information."

 

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.


powered by NetLogo

view/download model file: education_Income_information.nlogo

WHAT IS IT?

The model simulates the interactions between agents who own different levels of income and education. The agents that own lower levels of income and education try to imitate agents with higher values of these variables. The agents that are not satisfied then stop their working activity and they start to improve their education. Is important to evidence the role of information, well informed agents take better decisions regarding their formation, so the improvement of their education probably have more impact on their future income.


HOW IT WORKS

Each instant (that is represented by the aging factor of the agents) each "low income" agent choose a random agent with an higher level of education and income, then the agent start to improve his education to reach the "imitated" agent level of studies.
The effect on the income could be different if the "imitator" is well informed or not.


HOW TO USE IT

The button "Setup" create a number of agents equal to the number set on the slider "nAgents". For each agent the model assign a certain level of education and income. The x-axis of the world represent education, the y-axis represent income. The sliders "SystemAmbition" and "SystemInfo" permit to set the probabilities of having ambitious and well informed agents among the population.

The simulation start by clicking on the button "Go", then the agents start to move respecting their imitating formula and the results over average income and composition of the population are showed in the graphs.


EXTENDING THE MODEL

Users could try to change the sliders of "SystemAmbition" and "SystemInfo" to obtain different results.
Important implications could derive by observing the section of the composition of the population where the percentages of "low", "medium" and "high" education individuals are monitored.


PROCEDURES

breed [agents agent]
agents-own [education income age ambition wellinformed luck]

to setup
  clear-all
  create-agents nAgents
  set-parameters
  set-cor
end
  
to set-parameters
  ask agents [set shape "person"
              set education 1 + random (max-pxcor - 1)
              set income 1 + random (max-pycor - 1)
              set age random 100
              ifelse (random-float 1.0 <= SystemAmbition) [set ambition 1] [set ambition 0]
              ifelse (random-float 1.0 <= SystemInfo) [set wellinformed 1] [set wellinformed 0]
              set luck 0.5 + random-float 0.5]
end

to set-cor
  ask agents [set xcor education
              set ycor income
              if xcor <= 15 [set color yellow]
              if xcor > 15 and xcor <= 30 [set color green]
              if xcor > 30 [set color blue]]
end

to go
  aging
  educate-low-income
  educate-middle-income
  update-plotsI
  update-plotsII
  bad-luck
end

to aging
  ask agents [set age age + 1
              if age > 100 [die]
              if age > 99  [wait 0.01 hatch 1 [set education 1 + random (max-pxcor - 1)
                                           set income 1 + random (max-pycor - 1)
                                           set age 0
                                           ifelse (random-float 1.0 <= SystemAmbition) [set ambition 1] [set ambition 0]
                                           ifelse (random-float 1.2 <= SystemInfo) [set wellinformed 1] [set wellinformed 0]
                                           set luck 0.5 + random-float 0.5
                                           set xcor education
                                           set ycor income
                                           if xcor <= 15 [set color yellow]
                                           if xcor > 15 and xcor <= 30 [set color green]
                                           if xcor > 30 [set color blue]]]]
end

to educate-low-income

ask agents with [income < 15 and education < 15]
           [
            let better sort agents with [ income > 15 and education > 15 ]
            let c ([education] of one-of better - [education] of self)
            let n 3 + random-float 1.5
            let g random-float 2.0
            let p income - 1
            if ((0.5 * c) < p) and (ambition = 1)
                                          [ 
                                           if wellinformed = 1 [ repeat c [set education education + 1
                                                                           set income income - 0.5
                                                                           set xcor xcor + 1
                                                                           set ycor ycor - 0.5]
                                                               ]
                                           if wellinformed = 0 [repeat c [set education education + 1
                                                                          set income income - 0.5
                                                                          set xcor xcor + 1
                                                                          set ycor ycor - 0.5]
                                                               ]
                                                   
            wait 0.01
            let drw (0.5 + n) * c
            let drb (0.5 + g) * c
            let q (45 - p)
            if wellinformed = 1
                    [ if drw > q [ repeat q [set income income + 0.5
                                             set ycor ycor + 0.5]
                                 ]
                      if drw < q [ repeat drw [set income income + 0.5
                                               set ycor ycor + 0.5 ]
                                 ]
                    ]
            if wellinformed = 0
                    [ if drb > q [ repeat q [set income income + 0.5
                                             set ycor ycor + 0.5]
                                 ]
                      if drb < q [ repeat drb [set income income + 0.5 
                                               set ycor ycor + 0.5]
                                 ]
                    ]
                                          ]      
            if ((0.5 * c) > p) and (ambition = 1)
                          [ if wellinformed = 1 [ repeat p [set education education + 1
                                                            set income income - 0.5
                                                            set xcor xcor + 1
                                                            set ycor ycor - 0.5]
                                                            ]
                           if wellinformed = 0 [repeat p [set education education + 1
                                                          set income income - 0.5
                                                          set xcor xcor + 1
                                                          set ycor ycor - 0.5]
                                                                                    ]
            wait 0.01
            let drw (0.5 + n) * c
            let drb (0.5 + g) * c
            let q (45 - p)
            if wellinformed = 1
                    [ if drw > q [ repeat q [set income income + 0.5
                                             set ycor ycor + 0.5]
                                 ]
                      if drw < q [ repeat drw [set income income + 0.5
                                               set ycor ycor + 0.5 ]
                                 ]
                    ]
            if wellinformed = 0
                    [ if drb > q [ repeat q [set income income + 0.5
                                             set ycor ycor + 0.5]
                                 ]
                      if drb < q [ repeat drb [set income income + 0.5 
                                               set ycor ycor + 0.5]
                                 ]
                    ]
                                                   ]
                          set ambition 0
           ]

end




to educate-middle-income

ask agents with [income < 30 and education < 30 and income > 15 and education > 15]
           [
            let better sort agents with [ income > 30 and education > 30 ]
            let c ([education] of one-of better - [education] of self)
            let n 3 + random-float 1.5
            let g random-float 2.0
            let p income - 1
            if ((0.5 * c) < p) and (ambition = 1)
                                          [ 
                                           if wellinformed = 1 [ repeat c [set education education + 1
                                                                           set income income - 0.5
                                                                           set xcor xcor + 1
                                                                           set ycor ycor - 0.5]
                                                               ]
                                           if wellinformed = 0 [repeat c [set education education + 1
                                                                          set income income - 0.5
                                                                          set xcor xcor + 1
                                                                          set ycor ycor - 0.5]
                                                               ]
                                                   
            wait 0.01    
            let drw (0.5 + n) * c
            let drb (0.5 + g) * c
            let q (45 - p)
            if wellinformed = 1
                    [ if drw > q [ repeat q [set income income + 0.5
                                             set ycor ycor + 0.5]
                                 ]
                      if drw < q [ repeat drw [set income income + 0.5
                                               set ycor ycor + 0.5 ]
                                 ]
                    ]
            if wellinformed = 0
                    [ if drb > q [ repeat q [set income income + 0.5
                                             set ycor ycor + 0.5]
                                 ]
                      if drb < q [ repeat drb [set income income + 0.5 
                                               set ycor ycor + 0.5]
                                 ]
                    ]
                                          ]      
            if ((0.5 * c) > p) and (ambition = 1)
                          [ if wellinformed = 1 [ repeat p [set education education + 1
                                                            set income income - 0.5
                                                            set xcor xcor + 1
                                                            set ycor ycor - 0.5]
                                                                                                                                         ]
                           if wellinformed = 0 [repeat p [set education education + 1
                                                          set income income - 0.5
                                                          set xcor xcor + 1
                                                          set ycor ycor - 0.5]
                                                                                    ]
            wait 0.01
            let drw (0.5 + n) * c
            let drb (0.5 + g) * c
            let q (45 - p)
            if wellinformed = 1
                    [ if drw > q [ repeat q [set income income + 0.5
                                             set ycor ycor + 0.5]
                                 ]
                      if drw < q [ repeat drw [set income income + 0.5
                                               set ycor ycor + 0.5 ]
                                 ]
                    ]
            if wellinformed = 0
                    [ if drb > q [ repeat q [set income income + 0.5
                                             set ycor ycor + 0.5]
                                 ]
                      if drb < q [ repeat drb [set income income + 0.5 
                                               set ycor ycor + 0.5]
                                 ]
                    ]
                                                   ]
           set ambition 0
           ]

end




to update-plotsI
  set-current-plot "Number satisfied"
  set-current-plot-pen "satisfied"
  plot count agents with [ambition = 0] 
end


to update-plotsII
     set-current-plot "AverageIncome"
     set-current-plot-pen "bad"
     let aincomebad mean [income] of agents with [wellinformed = 0 and ambition = 1]
     plot aincomebad
     set-current-plot-pen "well"
     let aincomewell mean [income] of agents with [wellinformed = 1 and ambition = 1]
     plot aincomewell
end





to bad-luck
  ask agents [if 1 > luck [let badluck income * random 1.0
                                    set income income - badluck
                                    repeat badluck [set ycor ycor - 1]]]
  end