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: microcredit_and_child_labour.nlogo
Our model tests the effect of microcredit on child labour through the examination of three different categories of individuals with specific characteristics living in a rural village in Africa. The aim of the program is to analyze the negative effect of such instrument and to examine its impact combined with other variables.
The individuals in the simulation are children grouped in three samples according to the social status: landowners, entrepreneurs and workers. They are positioned in three different corners colored differently: brown for landowners, blue for entrepreneurs and pink for workers. Children in the initial situation are colored depending on their working/schooling/income condition. When their family membership is in contact with the microcredit banker or information agent, children change their status through the passage from one color to another one. In general the microcredit banker will have an incremental effect on child labour, while the information agent a decreasing one. Microcredit has a persistent effect only on the landowners’ category. Instead, information has a persistent effect on the entrepreneurs’ and workers’ category.
The slider wealth has to be set by the user before the setup. With this slider you can increase the income level of the families and see how the turtles react when they overtake their threshold.
Click the setup button to setup the three categories: landowners’ family, entrepreneurs’ family and workers’ family and to populate the three types of families and color the turtles according to their initial working/schooling/education/income status.
With the button Microcredit you create the banker in the center of the screen and then when the go will be activated it will move randomly.
With the button microcredit-to-landowner you direct thee banker into landowners’ family and then when the go will be activated it will move randomly only into the landowners’ family.
With the button microcredit-to-entrepreneurs you direct thee banker into entrepreneurs’ family and then when the go will be activated it will move randomly only into the entrepreneurs’ family.
With the button microcredit-to-workers you direct thee banker into workers’ family and then when the go will be activated it will move randomly only into the workers’ family.
With the button Information you activate the information agent who reaches the categories with a precise order (entrepreneurs, workers, landowners).
For the button of microcredit and information if you click a second time on them you make die respectively the banker and the information agent.
With the button go you activate the banker and the information agent and you can see the movement from workers’ to entrepreneurs’ family.
The workers’ category has an imitative behavior toward the entrepreneurs and therefore when the banker or information agent (or both them) is in contact with the entrepreneurs, there will be a change also in the workers’ category as they try to imitate. Anyway, it is interesting to notice that the change in the status of workers’ category is different when they meet directly the banker and information agent.
The user can experiment the “slider” consisting in a control of the level of wealth. It is interesting to modify this value in order to simulate different sceneries. A special case would be the movement of workers from their family of appartenence to the entrepreneurs’ family due both to their education and to their high level of wealth.
It would be interesting to study the model by adding the head household gender and see how the family decision maker impacts the child labour according to the gender. The model will be more complicated. In adittion, if we decide to introduce another “slider” consisting in a control of the level of education, would be interesting as education is an important tool to reduce the child labour problem. Theoretically we expect that a higher level of education is associated with a lower level of child labour, and if we add it to the model the result from its interaction with other variables could be an interesting case of study.
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
(models in the NetLogo Models Library and elsewhere which are of related interest)
The reference to create our model:
http://spol.unica.it/didattica/STRAZZERA/microcredit_africa.pdf
;################################################### Definition of the variables ##############################################################
globals [microcredit-on? ; presence of microcredit
information-on? ; presence of information
microcredit-to-landowners-on? ; presence of microcredit only in the landowner family
microcredit-to-entrepreneurs-on? ; presence of microcredit only in the entrepreneur family
microcredit-to-workers-on? ; presence of microcredit only in the worker family
basic-income
counter
time
imit_beha_banker? ; presence of workers' imitative behaviuor when banker goes to entreprenuers' family
imit_beha_inform? ; presence of workers' imitative behaviuor when information agent goes to entreprenuers' family
threshold ; presence of wealth's threshold
previously-pressed?
information-agent-die?
firsttime?
workerslime
workersyellow
]
breed [landowners landowner] ; 5 different breeds of turtles
breed [entrepreneurs entrepreneur]
breed [workers worker]
breed [bankers banker]
breed [information-agents information-agent]
landowners-own [ income ; landowners' income
landowners-information-agent-contact? ; if true the landowners' family has met the information agent
landowners-banker-contact?] ; if true the landowners' family has met the banker
entrepreneurs-own [ income ; entrepreneurs' income
entrepreneurs-information-agent-contact? ; if true the entrepreneurs' family has met the information agent
entrepreneurs-banker-contact? ; if true the entrepreneurs' family has met the banker
well-off]
workers-own [ income ; workers' income
workers-information-agent-contact? ; if true the workers' family has met the information agent
workers-banker-contact? ; if true the workers' family has met the banker
well-off]
; #################### Setup ##########################
to setup
ca
set microcredit-on? false
set information-on? false
set microcredit-to-landowners-on? false
set microcredit-to-entrepreneurs-on? false
set microcredit-to-workers-on? false
set basic-income wealth ; the value of basic income depends on the value of slider of wealth
set counter -1
set time 10
set threshold 200 ; the threshold is 200
set firsttime? true
set previously-pressed? false
set information-agent-die? false
setup-turtles ; creation of landowners, entrepreneurs, and workers and their placement in the respective family
ask patches [setup-landowners-family ; creation of landowners' family, entrepreneurs' family and workers family
setup-entrepreneurs-family
setup-workers-family]
color-landowners ; the landowners are colored
color-entrepreneurs ; the entrepreneurs are colored
color-workers ; the workers are colored
increase-wealth ; when entreprenuers or workers or landowners have their income above the threshold they, respectively, improve their conditions
do-plots
reset-ticks
end
to setup-landowners-family ; The landowners family is set brown and it is placed in the lower left corner
if (pxcor <= -6) and (pxcor >= -16) and (pycor <= -6) and (pycor >= -16)
[set pcolor brown]
end
to setup-entrepreneurs-family ; The entrepreneurs family is light blue and it is placed in the lower right corner
if (pxcor <= 16) and (pxcor >= 6) and (pycor <= -6) and (pycor >= -16)
[set pcolor sky - 3]
end
to setup-workers-family ; The workers family is light violet and it is placed in the upper right corner
if (pxcor <= 16) and (pxcor >= 6) and (pycor <= 16) and (pycor >= 6)
[set pcolor magenta + 3 ]
end
to setup-turtles
set-default-shape landowners "person"
create-landowners 120 [ask landowners [set color white]
set size 1.0
setxy ((random 10)+ -16) ((random 10)+ -16)
set income (basic-income + random (basic-income * 0.1))
set landowners-banker-contact? false
set landowners-information-agent-contact? false]
set-default-shape entrepreneurs "person"
create-entrepreneurs 50 [ask entrepreneurs [set color white]
set size 1.0
setxy ((random -10)+ 16) ((random 10)+ -16)
set income (basic-income + random (basic-income * 0.2))
set entrepreneurs-banker-contact? false
set entrepreneurs-information-agent-contact? false
set imit_beha_banker? false
set imit_beha_inform? false
set well-off 0]
set-default-shape workers "person"
create-workers 80 [ask workers [set color white]
set size 1.0
setxy ((random -10)+ 16) ((random -10)+ 16)
set income (basic-income + random (basic-income * 0.15))
set workers-banker-contact? false
set workers-information-agent-contact? false
set well-off 0]
end
to color-landowners
if firsttime? = true [
ask landowners [if landowners-banker-contact? = false and landowners-information-agent-contact? = false and (pxcor <= -11) and (pxcor >= -16) and (pycor <= -6) and (pycor >= -16)
[set color black]]
ask landowners [if landowners-banker-contact? = false and landowners-information-agent-contact? = false and (pxcor <= -6) and (pxcor > -11) and (pycor <= -6) and (pycor >= -10)
[set color gray]]
ask landowners [if landowners-banker-contact? = false and landowners-information-agent-contact? = false and (pxcor <= -6) and (pxcor > -11) and (pycor < -10) and (pycor >= -11)
[set color lime]]
ask landowners [if landowners-banker-contact? = false and landowners-information-agent-contact? = false and (pxcor <= -6) and (pxcor > -11) and (pycor < -11) and (pycor >= -14)
[set color gray + 2 ]]
ask landowners [if landowners-banker-contact? = false and landowners-information-agent-contact? = false and (pxcor <= -6) and (pxcor > -11) and (pycor < -14) and (pycor >= -16)
[set color lime + 3 ]]]
end
to color-entrepreneurs
if firsttime? = true [
ask entrepreneurs [if entrepreneurs-banker-contact? = false and entrepreneurs-information-agent-contact? = false and (pxcor <= 11) and (pxcor >= 6) and (pycor <= -11) and (pycor >= -16)
[set color yellow]]
ask entrepreneurs [if entrepreneurs-banker-contact? = false and entrepreneurs-information-agent-contact? = false and (pxcor <= 11) and (pxcor >= 6) and (pycor <= -6) and (pycor > -11)
[set color lime]]
ask entrepreneurs [if entrepreneurs-banker-contact? = false and entrepreneurs-information-agent-contact? = false and (pxcor <= 16) and (pxcor > 11) and (pycor <= -15) and (pycor >= -16)
[set color gray + 2]]
ask entrepreneurs [if entrepreneurs-banker-contact? = false and entrepreneurs-information-agent-contact? = false and (pxcor <= 16) and (pxcor > 11) and (pycor <= -13) and (pycor > -15)
[set color gray]]
ask entrepreneurs [if entrepreneurs-banker-contact? = false and entrepreneurs-information-agent-contact? = false and (pxcor <= 16) and (pxcor > 11) and (pycor <= -6) and (pycor > -13)
[set color lime + 3]]]
end
to color-workers
if firsttime? = true [
ask workers [if workers-banker-contact? = false and workers-information-agent-contact? = false and (pxcor <= 16) and (pxcor > 11) and (pycor <= 9) and (pycor >= 6)
[set color gray + 2]]
ask workers [if workers-banker-contact? = false and workers-information-agent-contact? = false and (pxcor <= 16) and (pxcor > 11) and (pycor < 12) and (pycor > 9)
[set color black]]
ask workers [if workers-banker-contact? = false and workers-information-agent-contact? = false and (pxcor <= 16) and (pxcor > 11) and (pycor <= 14) and (pycor >= 12)
[set color yellow]]
ask workers [if workers-banker-contact? = false and workers-information-agent-contact? = false and (pxcor <= 16) and (pxcor > 11) and (pycor <= 16) and (pycor > 14)
[set color lime]]
ask workers [if workers-banker-contact? = false and workers-information-agent-contact? = false and (pxcor <= 11) and (pxcor >= 6) and (pycor <= 12) and (pycor >= 6)
[set color lime + 3]]
ask workers [if workers-banker-contact? = false and workers-information-agent-contact? = false and (pxcor <= 11) and (pxcor >= 6) and (pycor <= 16) and (pycor > 12)
[set color gray]]]
end
to microcredit
ifelse microcredit-on? = false
[set microcredit-on? true ; creation of banker
set-default-shape bankers "person business"
create-bankers 1 [set size 2.0
set color red]]
[set microcredit-on? false ; banker dies
set microcredit-to-workers-on? false
set microcredit-to-entrepreneurs-on? false
set microcredit-to-landowners-on? false
set previously-pressed? false
ask bankers [die]
ask workers [set workers-banker-contact? false ; when banker is died, the microcredit has not a persistent effect on workers
set imit_beha_banker? false]
ask entrepreneurs [set entrepreneurs-banker-contact? false]] ; when banker is died, the microcredit has not a persistent effect on entrepreneurs
end
to microcredit-to-landowners
if microcredit-on? = false
[set microcredit-on? true
set-default-shape bankers "person business"
create-bankers 1 [set size 2.0
set color red]]
set microcredit-to-entrepreneurs-on? false
set microcredit-to-workers-on? false
ifelse previously-pressed? = false
[set microcredit-to-landowners-on? true
ask bankers [move-to one-of patches with [pcolor = brown]]
set previously-pressed? true]
[ifelse microcredit-to-landowners-on? = true
[set microcredit-to-landowners-on? false
set previously-pressed? false
ask bankers [move-to one-of patches ]]
[set microcredit-to-landowners-on? true
set previously-pressed? true
ask bankers [move-to one-of patches with [pcolor = brown ]]]]
end
to microcredit-to-entrepreneurs
if microcredit-on? = false
[set microcredit-on? true
set-default-shape bankers "person business"
create-bankers 1 [set size 2.0
set color red]]
set microcredit-to-landowners-on? false
set microcredit-to-workers-on? false
ifelse previously-pressed? = false
[set microcredit-to-entrepreneurs-on? true
set previously-pressed? true
ask bankers [move-to one-of patches with [pcolor = sky - 3]]]
[ifelse microcredit-to-entrepreneurs-on? = true
[set microcredit-to-entrepreneurs-on? false
set previously-pressed? false
ask bankers [move-to one-of patches ]]
[set microcredit-to-entrepreneurs-on? true
set previously-pressed? true
ask bankers [move-to one-of patches with [pcolor = sky - 3 ]]]]
end
to microcredit-to-workers ; this procedure activates the banker's activity
if microcredit-on? = false
[set microcredit-on? true
set-default-shape bankers "person business"
create-bankers 1 [set size 2.0
set color red]]
set microcredit-to-entrepreneurs-on? false
set microcredit-to-landowners-on? false
ifelse previously-pressed? = false
[set microcredit-to-workers-on? true
set previously-pressed? true
ask bankers [move-to one-of patches with [pcolor = magenta + 3]]]
[ifelse microcredit-to-workers-on? = true
[set microcredit-to-workers-on? false
set previously-pressed? false
ask bankers [move-to one-of patches ]]
[set microcredit-to-workers-on? true
set previously-pressed? true
ask bankers [move-to one-of patches with [pcolor = magenta + 3 ]]]]
end
to information ; this procedure activates the informator's activity
ifelse information-on? = false
[set information-on? true
set information-agent-die? false
set-default-shape information-agents "person service"
create-information-agents 1 [ set size 2.0
set color blue
setxy -15 15 ]]
[set information-on? false
ask information-agents [die]
if not any? information-agents-on patches with [pcolor = brown or pcolor = black]
[ask landowners [set landowners-information-agent-contact? false]]
set information-agent-die? true
]
end
to increase-wealth
if firsttime? = true [
ask landowners [if income >= threshold and color = gray [set color gray + 2]]
ask landowners [if income >= threshold and color = black [set color gray + 2]]
ask entrepreneurs [if income >= threshold and color = lime + 3 [set color yellow]]
ask entrepreneurs [if income >= threshold and color = lime [set color lime]]
ask entrepreneurs [if income >= threshold and color = gray [set color lime]]
ask entrepreneurs [if income >= threshold and color = gray + 2 [set color lime]]
ask workers [if income >= threshold and color = yellow [set well-off 1]]
ask workers [if income >= threshold and color = lime + 3 [set well-off 1]]
ask workers [if income >= threshold and color = lime [set color yellow]]
ask workers [if income >= threshold and color = gray [set color lime + 3]]
ask workers [if income >= threshold and color = gray + 2 [set color lime + 3]]
set firsttime? false
]
end
to do-plots
set-current-plot "Total children" ; Set the graph
set-current-plot-pen "economic-work"
plot count turtles with [color = gray]
set-current-plot-pen "domestic-work"
plot count turtles with [color = gray + 2]
set-current-plot-pen "school-attendance"
plot count turtles with [color = yellow]
set-current-plot-pen "domestic-work+economic-work"
plot count turtles with [color = black]
set-current-plot-pen "education+economic-work"
plot count turtles with [color = lime]
set-current-plot-pen "education+domestic-work"
plot count turtles with [color = lime + 3]
set-current-plot-pen "education+domestic-work+economic-work"
plot count turtles with [color = lime - 2]
end
;#################################################################### Go #################################################################################
to go
move-workers-once
do-plots
move-bankers
move-information-agents
start
tick
end
to move-bankers
ifelse microcredit-to-landowners-on? = true
[ask bankers [move-to one-of patches with [pcolor = brown]]]
[ifelse microcredit-to-entrepreneurs-on? = true
[ask bankers [move-to one-of patches with [pcolor = sky - 3]]]
[ifelse microcredit-to-workers-on? = true
[ask bankers [move-to one-of patches with [pcolor = magenta + 3]]]
[ask bankers [right random 180 forward 5]]
]
]
end
to move-information-agents
if information-agent-die? = false and information-on? = true
[set counter -1
set information-agent-die? true
]
if any? information-agents-on patches with [pcolor = black] and counter = -1
[ask information-agents [move-to one-of patches with [pcolor = sky - 3]]
set counter 0
]
if any? information-agents-on patches with [pcolor = sky - 3] and counter < time
[set counter (counter + 1)]
if any? information-agents-on patches with [pcolor = sky - 3] and counter = time
[ask information-agents [ move-to one-of patches with [pcolor = magenta + 3]]]
if any? information-agents-on patches with [pcolor = magenta + 3] and counter = time
[set counter 0]
if any? information-agents-on patches with [pcolor = magenta + 3] and counter < time
[set counter (counter + 1)]
if any? information-agents-on patches with [pcolor = magenta + 3] and counter = time
[ask information-agents [ move-to one-of patches with [pcolor = brown]]
ask landowners [set landowners-information-agent-contact? true]]
if any? information-agents-on patches with [pcolor = brown] and counter = time
[set counter 0]
if any? information-agents-on patches with [pcolor = brown] and counter < time
[set counter (counter + 1)]
if any? information-agents-on patches with [pcolor = brown] and counter = time
[ask information-agents [ move-to one-of patches with [pcolor = black]]]
if any? information-agents-on patches with [pcolor = black] and counter = time
[set counter 0
ask landowners [set landowners-information-agent-contact? false]]
end
to start
ask landowners [landowners/banker/information-agent
]
ask entrepreneurs [entrepreneurs/banker/information-agent
]
ask workers [workers/banker/information-agent
]
end
to landowners/banker/information-agent
if any? bankers-on patches with [(pcolor = brown)] [set landowners-banker-contact? true]
if any? information-agents-on patches with [(pcolor = brown)] [set landowners-information-agent-contact? true]
ask landowners [ if landowners-banker-contact? = true and landowners-information-agent-contact? = false and (color = gray)
[set color black]]
ask landowners [ if landowners-banker-contact? = true and landowners-information-agent-contact? = false and (color = gray + 2)
[set color gray + 2]]
ask landowners [ if landowners-banker-contact? = true and landowners-information-agent-contact? = false and (color = lime)
[set color lime - 2]]
ask landowners [ if landowners-banker-contact? = true and landowners-information-agent-contact? = false and (color = lime + 3)
[set color lime - 2]]
ask landowners [ if landowners-banker-contact? = true and landowners-information-agent-contact? = true and ( color = lime)
[set color gray]]
ask landowners [ if landowners-banker-contact? = true and landowners-information-agent-contact? = true and ( color = lime + 3)
[set color lime - 2]]
ask landowners [ if landowners-information-agent-contact? = true and landowners-banker-contact? = true and (color = black)
[set color gray]]
ask landowners [ if landowners-information-agent-contact? = true and landowners-banker-contact? = false and (color = black)
[set color gray]]
ask landowners [ if landowners-information-agent-contact? = true and landowners-banker-contact? = false and (color = gray + 2)
[set color lime + 3]]
ask landowners [ if landowners-information-agent-contact? = true and landowners-banker-contact? = false and (color = lime - 2)
[set color lime]]
ask landowners [if landowners-banker-contact? = false and income < threshold and landowners-information-agent-contact? = false and (pxcor <= -11) and (pxcor >= -16) and (pycor <= -6) and (pycor >= -16)
[set color black]]
ask landowners [if landowners-banker-contact? = false and income < threshold and landowners-information-agent-contact? = false and (pxcor <= -6) and (pxcor > -11) and (pycor <= -6) and (pycor >= -10)
[set color gray]]
ask landowners [if landowners-banker-contact? = false and income < threshold and landowners-information-agent-contact? = false and (pxcor <= -6) and (pxcor > -11) and (pycor < -10) and (pycor >= -11)
[set color lime]]
ask landowners [if landowners-banker-contact? = false and income < threshold and landowners-information-agent-contact? = false and (pxcor <= -6) and (pxcor > -11) and (pycor < -11) and (pycor >= -14)
[set color gray + 2 ]]
ask landowners [if landowners-banker-contact? = false and income < threshold and landowners-information-agent-contact? = false and (pxcor <= -6) and (pxcor > -11) and (pycor < -14) and (pycor >= -16)
[set color lime + 3 ]]
end
to entrepreneurs/banker/information-agent
if any? bankers-on patches with [(pcolor = sky - 3)] [set entrepreneurs-banker-contact? true
set imit_beha_banker? true]
if any? information-agents-on patches with [(pcolor = sky - 3)] [set entrepreneurs-information-agent-contact? true
set imit_beha_inform? true]
ask entrepreneurs [ if entrepreneurs-banker-contact? = true and entrepreneurs-information-agent-contact? = false and (color = yellow)
[set color lime + 3 ]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = true and entrepreneurs-information-agent-contact? = false and (color = gray + 2)
[set color gray + 2 ]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = true and entrepreneurs-information-agent-contact? = false and (color = lime)
[set color lime - 2]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = true and entrepreneurs-information-agent-contact? = false and (color = gray)
[set color gray]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = false and entrepreneurs-information-agent-contact? = true and (color = gray)
[set color yellow]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = false and entrepreneurs-information-agent-contact? = true and (color = lime + 3)
[set color lime + 3]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = false and entrepreneurs-information-agent-contact? = true and (color = gray + 2)
[set color lime + 3]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = false and entrepreneurs-information-agent-contact? = true and (color = lime - 2)
[set color lime + 3]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = false and entrepreneurs-information-agent-contact? = true and (color = lime)
[set color yellow]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = true and entrepreneurs-information-agent-contact? = true and (color = yellow)
[set color yellow]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = true and entrepreneurs-information-agent-contact? = true and (color = lime + 3)
[set color lime + 3]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = true and entrepreneurs-information-agent-contact? = true and (color = gray)
[set color lime + 3]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = true and entrepreneurs-information-agent-contact? = true and (color = lime - 2)
[set color lime + 3]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = true and entrepreneurs-information-agent-contact? = true and (color = gray + 2)
[set color lime + 3]]
ask entrepreneurs [ if entrepreneurs-banker-contact? = true and entrepreneurs-information-agent-contact? = true and (color = lime)
[set color yellow]]
ask entrepreneurs [if entrepreneurs-banker-contact? = false and income < threshold and entrepreneurs-information-agent-contact? = false and (pxcor <= 11) and (pxcor >= 6) and (pycor <= -11) and (pycor >= -16)
[set color yellow]]
ask entrepreneurs [if entrepreneurs-banker-contact? = false and income < threshold and entrepreneurs-information-agent-contact? = false and (pxcor <= 11) and (pxcor >= 6) and (pycor <= -6) and (pycor > -11)
[set color lime]]
ask entrepreneurs [if entrepreneurs-banker-contact? = false and income < threshold and entrepreneurs-information-agent-contact? = false and (pxcor <= 16) and (pxcor > 11) and (pycor <= -15) and (pycor >= -16)
[set color gray + 2]]
ask entrepreneurs [if entrepreneurs-banker-contact? = false and income < threshold and entrepreneurs-information-agent-contact? = false and (pxcor <= 16) and (pxcor > 11) and (pycor <= -13) and (pycor > -15)
[set color gray]]
ask entrepreneurs [if entrepreneurs-banker-contact? = false and income < threshold and entrepreneurs-information-agent-contact? = false and (pxcor <= 16) and (pxcor > 11) and (pycor <= -6) and (pycor > -13)
[set color lime + 3]]
end
to workers/banker/information-agent
if any? bankers-on patches with [(pcolor = magenta + 3)] [set workers-banker-contact? true
]
if any? information-agents-on patches with [(pcolor = magenta + 3)] [set workers-information-agent-contact? true]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = false and (color = yellow)
[set color lime + 3 ]]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = false and (color = gray + 2)
[set color gray + 2 ]]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = false and (color = lime + 3)
[set color lime + 3 ]]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = false and (color = black)
[set color black ]]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = false and (color = gray)
[set color gray]]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = false and (color = lime )
[set color lime - 2]]
ask workers [ if imit_beha_banker? = false and imit_beha_inform? = true and (color = lime)
[set color lime - 2 ]]
ask workers [ if imit_beha_banker? = false and imit_beha_inform? = true and (color = gray)
[set color gray + 2 ]]
ask workers [ if imit_beha_banker? = false and imit_beha_inform? = true and (color = lime + 3)
[set color lime + 3 ]]
ask workers [ if imit_beha_banker? = false and imit_beha_inform? = true and (color = gray + 2)
[set color gray + 2 ]]
ask workers [ if imit_beha_banker? = false and imit_beha_inform? = true and (color = black)
[set color gray ]]
ask workers [ if imit_beha_banker? = false and imit_beha_inform? = true and (color = lime - 2)
[set color lime - 2 ]]
ask workers [if imit_beha_banker? = false and imit_beha_inform? = false and income < threshold and (pxcor <= 16) and (pxcor > 11) and (pycor <= 9) and (pycor >= 6)
[set color gray + 2]]
ask workers [if imit_beha_banker? = false and imit_beha_inform? = false and income < threshold and (pxcor <= 16) and (pxcor > 11) and (pycor < 12) and (pycor > 9)
[set color black]]
ask workers [if imit_beha_banker? = false and imit_beha_inform? = false and income < threshold and (pxcor <= 16) and (pxcor > 11) and (pycor <= 14) and (pycor >= 12)
[set color yellow]]
ask workers [if imit_beha_banker? = false and imit_beha_inform? = false and income < threshold and (pxcor <= 16) and (pxcor > 11) and (pycor <= 16) and (pycor > 14)
[set color lime]]
ask workers [if imit_beha_banker? = false and imit_beha_inform? = false and income < threshold and (pxcor <= 11) and (pxcor >= 6) and (pycor <= 12) and (pycor >= 6)
[set color lime + 3]]
ask workers [if imit_beha_banker? = false and imit_beha_inform? = false and income < threshold and (pxcor <= 11) and (pxcor >= 6) and (pycor <= 16) and (pycor > 12)
[set color gray]]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = true and (color = lime)
[set color lime ]]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = true and (color = lime + 3)
[set color lime + 3]]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = true and (color = black)
[set color gray]]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = true and (color = lime - 2)
[set color lime]]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = true and (color = gray)
[set color gray]]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = true and (color = yellow)
[set color yellow]]
ask workers [ if imit_beha_banker? = true and imit_beha_inform? = true and (color = gray + 2)
[set color gray + 2]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = false and (color = yellow)
[set color lime ]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = false and (color = gray + 2)
[set color black ]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = false and (color = lime + 3)
[set color lime - 2 ]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = false and (color = black)
[set color black ]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = false and (color = gray)
[set color gray]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = false and (color = lime )
[set color lime]]
ask workers [ if workers-banker-contact? = false and workers-information-agent-contact? = true and (color = gray)
[set color lime ]]
ask workers [ if workers-banker-contact? = false and workers-information-agent-contact? = true and (color = lime + 3)
[set color lime + 3 ]]
ask workers [ if workers-banker-contact? = false and workers-information-agent-contact? = true and (color = gray + 2)
[set color gray + 2 ]]
ask workers [ if workers-banker-contact? = false and workers-information-agent-contact? = true and (color = black)
[set color gray + 2 ]]
ask workers [ if workers-banker-contact? = false and workers-information-agent-contact? = true and (color = lime - 2)
[set color lime + 3 ]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = true and (color = lime)
[set color lime]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = true and (color = lime + 3)
[set color lime + 3]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = true and (color = black)
[set color gray]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = true and (color = lime - 2)
[set color lime + 3]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = true and (color = gray)
[set color gray]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = true and (color = yellow)
[set color yellow]]
ask workers [ if workers-banker-contact? = true and workers-information-agent-contact? = true and (color = gray + 2)
[set color lime + 3]]
end
to move-workers-once
set workersyellow (count workers with [well-off = 1 and color = yellow])
set workerslime (count workers with [well-off = 1 and color = lime + 3])
ask workers with [well-off = 1] [die]
create-entrepreneurs (workersyellow) [set well-off 1
ask entrepreneurs with [well-off = 1] [set color yellow]
set size 1.0
setxy ((random -10)+ 16) ((random 10)+ -16)
set income 230
set entrepreneurs-banker-contact? false
set entrepreneurs-information-agent-contact? false
set imit_beha_banker? false
set imit_beha_inform? false]
create-entrepreneurs (workerslime) [set well-off 2
ask entrepreneurs with [well-off = 2][set color lime + 3]
set size 1.0
setxy ((random -10)+ 16) ((random 10)+ -16)
set income 230
set entrepreneurs-banker-contact? false
set entrepreneurs-information-agent-contact? false
set imit_beha_banker? false
set imit_beha_inform? false]
end