turtles-own[opinion stability new-opinion opinion-of-neighbours] ; every turtle own 4 variables breed[left-voters left-voter] ; these 5 breeds represent the population divided by opinion breed[centre-left-voters centre-left-voter] ; in our case the opinion is (almost) equivalent to political preference breed[centre-voters centre-voter] breed[centre-right-voters centre-right-voter] breed[right-voters right-voter] breed[right-party right-leaders] ; these two breeds represent political or opinion leaders breed[left-party left-leaders] to setup ca create-population ;creates the population of voters create-political-leaders ; creates political leaders form-opinion-of-neighbours ; explained below assign-stability-of-opinion change-stability-of-opinion end to go if count turtles with [breed = centre-voters] >= count turtles [stop] move-leaders form-opinion-of-neighbours form-new-opinion change-opinion change-color political-leaders-action tick do-plots end to create-population ask patches [ sprout 1 ;every patch creates one "person" (voter) set pcolor white ] ; patches set white color for better visibility ask turtles [ if breed != right-party and breed != left-party ; exclude political leaders from this command [ set opinion ( random-float (1.0) ) ; assign a random value from 0 to 1 to the opinion of every voter if opinion > -0.15 and opinion <= (0.05 + rightvoters) ;noise is a slider that can vary the opinion of all turtles [ set color 105 ; these commands divide the population in breeds set breed right-voters] if opinion > 0.05 + rightvoters and opinion <= 0.35 ; rightvoters is a slider which control the superior (inferior) [ set color 95 ;limit of right-voters (centre-right-voters) breed set breed centre-right-voters] if opinion > 0.35 and opinion <= 0.65 [set color 4 set breed centre-voters] if opinion > 0.65 and opinion <= 0.95 - leftvoters [set color 25 set breed centre-left-voters] if opinion > 0.95 - leftvoters and opinion <= 1.15 ;leftvoters same as rightvoters for these breeds [set color 15 set breed left-voters] ] ] set-default-shape turtles "person" end to assign-stability-of-opinion ; assign a random value to the stability of voter's opinion ask turtles[if breed != left-party ; the higher is stability of agent the harder is to change her opinion and breed != right-party [ set stability random-float 1.0 ] ] end to create-political-leaders ; creates political leaders create-turtles number-of-left-leaders [ ; we assign the number of leaders to create with a slider setxy random-xcor random-ycor ; the leaders are divided in two opposite breeds set breed left-party set color 125 set opinion 1] create-turtles number-of-right-leaders [ setxy random-xcor random-ycor set breed right-party set color black set opinion 0] ask right-party [set shape "circle"] ; set this shape to distinguish them from the voters ask left-party [set shape "circle"] end to form-opinion-of-neighbours ; opinion-of-neighbours is an auxiliary variable ; it measures the average opinion of neighbours for all turtles ask turtles [ if breed != left-party and breed != right-party [ set opinion-of-neighbours mean [opinion] of turtles in-radius 1 with [ breed != left-party and breed != right-party ] ]] end to move-leaders ; political leaders move casually among the population ask turtles[ if breed = left-party or breed = right-party [right random 360 fd 2 ] ] end to form-new-opinion ; this function calculates a second auxiliary turtle variable: new opinion ask turtles ; it's calculated as a weighted average of opinion and opinion-of-neighbors of a turtle [ ; the weight is given by influence a variable controled with a slider if breed = centre-voters ; influence measures the importance of opinion-of-neighbors in the formation of new-opinion [ set new-opinion ( influence * (opinion-of-neighbours + noise) + (1 - influence) * opinion ) ] if breed = centre-right-voters or breed = centre-left-voters ; we introduce an element of noise that can vary the opinion-of-neighbors [ ; or its "perception" by a voter set new-opinion ( 0.75 * influence * (opinion-of-neighbours + noise) + (1 - 0.75 * influence) * opinion ) ] if breed = right-voters or breed = left-voters [ set new-opinion ( 0.5 * influence * (opinion-of-neighbours + 0.5 * noise) + (1 - 0.5 * influence) * opinion) ] ] end to political-leaders-action ; political leaders have the ability to change the opinion of the voters they meet ask turtles[ if any? turtles in-radius 2 with [ breed = left-party ] [ set opinion (0.99 * (1 - stability) + opinion * stability) ] if any? turtles in-radius 2 with [ breed = right-party ] [ set opinion (0.01 * (1 - stability) + opinion * stability)] ] end to change-stability-of-opinion ;we introduce the possibility to change the stability of opinion in all turtles ask turtles [ if breed != left-party and breed != right-party [ if opinion-stability < 0 ; if the value of (stability + opinion-stability) is negative, [ifelse stability < abs opinion-stability ; stability goes to 0 [set stability 0] [set stability stability + opinion-stability]] if opinion-stability > 0 [ifelse (1 - stability) < opinion-stability ; if the value of (stability + opinion-stability) > 1.0 [set stability 1] ; stability goes to 1 [set stability stability + opinion-stability]] ] ] end to change-opinion ; this function changes the opinion of all turtles ask turtles [ if breed != left-party ; the opinion is given by the weighted average of (old) opinion and new-opinion or breed != right-party ; the weight is given by stability [ set opinion (opinion * stability + new-opinion * (1 - stability )) ] ] ; the higher the stability, the more weight is given to (old) opinion end to change-color ; this function changes the breed of turtles, in dependence of their changed opinion ask turtles [ if opinion > 0.1 and opinion <= (0.05 + rightvoters) [ set color 105 set breed right-voters] if opinion > 0.05 + rightvoters and opinion <= 0.35 [ set color 95 set breed centre-right-voters] if opinion > 0.35 and opinion <= 0.65 [set color 4 set breed centre-voters] if opinion > 0.65 and opinion <= 0.95 - leftvoters [set color 25 set breed centre-left-voters] if opinion > 0.95 - leftvoters and opinion < 0.99 [set color 15 set breed left-voters] ] end to do-plots ;we plot the percentage of right, left, centre voters on total number of turtles set-current-plot-pen "%right-voters" plot (count turtles with [ breed = right-voters]/ count turtles)* 100 set-current-plot-pen "%left-voters" plot (count turtles with [ breed = left-voters ]/ count turtles)* 100 set-current-plot-pen "%centre-voters" plot (count turtles with [ breed = centre-voters]/ count turtles) * 100 set-current-plot-pen "%centre-right" plot (count turtles with [ breed = centre-right-voters]/ count turtles)* 100 set-current-plot-pen "%centre-left" plot (count turtles with [ breed = centre-left-voters ]/ count turtles)* 100 end @#$#@#$#@ GRAPHICS-WINDOW 238 10 758 551 25 25 10.0 1 10 1 1 1 0 1 1 1 -25 25 -25 25 1 1 1 ticks CC-WINDOW 5 581 767 676 Command Center 0 MONITOR 1 334 89 379 % centre-left (count turtles with [breed = centre-left-voters] / count turtles)* 100 2 1 11 MONITOR 59 287 121 332 %centre (count turtles with [breed = centre-voters]/ count turtles)* 100 2 1 11 MONITOR -1 287 58 332 %left (count turtles with [breed = left-voters ]/ count turtles)* 100 2 1 11 MONITOR 90 334 182 379 %centre-right (count turtles with [breed = centre-right-voters ]/ count turtles)* 100 2 1 11 MONITOR 123 287 180 332 %right (count turtles with [breed = right-voters]/ count turtles) * 100 2 1 11 SLIDER 6 61 178 94 leftvoters leftvoters 0 0.3 0.15 0.01 1 NIL HORIZONTAL SLIDER 7 108 179 141 rightvoters rightvoters 0 0.3 0.15 0.01 1 NIL HORIZONTAL BUTTON 1 15 71 48 NIL setup NIL 1 T OBSERVER NIL NIL NIL NIL SLIDER 5 144 180 177 number-of-left-leaders number-of-left-leaders 0 10 5 1 1 NIL HORIZONTAL SLIDER 2 178 184 211 number-of-right-leaders number-of-right-leaders 0 10 5 1 1 NIL HORIZONTAL BUTTON 77 15 140 48 NIL go T 1 T OBSERVER NIL NIL NIL NIL SLIDER 5 218 211 251 noise noise -0.03 0.03 0 0.001 1 NIL HORIZONTAL SLIDER 8 253 180 286 influence influence 0 1 1 0.05 1 NIL HORIZONTAL PLOT 2 417 233 567 totals time % population 0.0 0.0 0.0 0.0 true true PENS "%right-voters" 1.0 0 -13345367 true "%left-voters" 1.0 0 -2674135 true "%centre-voters" 1.0 0 -16777216 true "%centre-right" 1.0 0 -13791810 true "%centre-left" 1.0 0 -2064490 true SLIDER 2 381 227 414 opinion-stability opinion-stability -0.15 0.15 -0.1 0.01 1 NIL HORIZONTAL @#$#@#$#@ WHAT IS IT? ----------- The model is trying to show the dynamics of opinion formation on a specific political issue: the optimal size of the public sector in economy, in the presence of political leaders. Since this issue reflects the typical political division in a country ( right, centre, left ), we divide our turtles in 5 groups of voters. HOW IT WORKS ------------ At the beginning, every patch sprouts a turtle. We assign a random value (from 0 to 1) to the opinion of every turtle (voter), and as a consequence all turtles are divided in 5 breeds, distinguished by the colour of turtles. The voters cannot move in the world. We can modify the initial proportion of different breeds. Left and right breeds can vary from 0 to 35% of the total papulation, so do the centre-left and centre-right breeds, while centre-voters breed remains always at 30%. Additionally, every voter has a random value (from 0 to 1) for another variable - stability of opinion. If the value of stability is 1, the agent never changes her opinion. Political leaders are another type of agents, shaped as a circle. They are divided in 2 opposite groups (left and right) and have the capacity to change the opinion of the voters they meet. When the simulation starts, the voters begin to interact, changing their opinion. Without introducing political leaders all voters adopt the average opinion and converges in the centre-voters breed. When we try to change the variables like influence or opinion-stability, the dynamics changes. Introducing political leaders makes the simulation more realistic; in this case may emerge different long-run equilibria. HOW TO USE IT ------------- We explain below the function of every object in the interface tab. Buttons: 1.setup Creates the world, the population of voters and (optional) the political leaders. It assigns too the values for stability and opinion to the voters. 2.go Starts the simulation; the voters begin to interact and form new opinion; the political leaders begin to "convince" the voters they meet. Sliders 1.leftvoters controls the proportion of left-voters (centre-left-voters) in the population from a minimum of 5% to 35%. 2.rightvoters same as leftvoters slider for right-voters (centre-right-voters) 3.number-of-left-leaders with this slider we can vary the number of left political leaders created at the beginning of the simulation (from 0 to 10). 4.number-of-right-leaders same as the above slider, controls the number of right leaders created. 5.noise slider which can introduce an element of disturbance in the perception of other voters' opinion; if it's high and persistent enough it can overturn the long-run equilibrium. 6.influence represents the weight that we give to the opinion of neighboring turtles in the formation of new individual opinion. 7.opinion-stability with this slider we can modify the initial stability assigned to every turtle. Monitors 5 monitors displays the proportion of the total population represented by 5 groups of voters. Plots indicates the evolution of the public opinion in time; 5 pens represent 5 different breeds of voters (red - left-voters, blue - right-voters, black - centre-voters, sky - centre-right-voters and pink - centre-left-voters) THINGS TO NOTICE ---------------- Without changing the initial settings and introducing political leaders, all voters converge in the centre-voters breed after few ticks. By changing influence and proportion of extreme voters (right-voters, left-voters) we can modify the speed of this convergence, but the result is the same. If we increase the stability of opinion, the long-run proportion of centre-voters is lower than in the first case. THINGS TO TRY ------------- Try to change the initial parameters of the simulation and observe the dynamics; Introduce the political-leaders, the dynamics becomes more unpredictable, and the long-run equilibrium is not obvious. EXTENDING THE MODEL ------------------- Introduce links among turtles give them the possibility to interact and consider the opinions not only of neighbors but the opinions of distant turtles too. Make the interaction among turtles more articulated, to reflect the real interaction between individual, perhaps by introducing additional variables and the capacity of the turtles to learn from past experiences. RELATED MODELS -------------- Voting model in NetLogo model library. REFERENCES ---------------------- Blinder, Alan S., and Alan B. Krueger.2004.What does the public know about economic policy, and how does it know it? Working paper 10787. NBER. Cambridge(MA). http://www.nber.org/papers/w10787 Fatas-Villafranca, F., D.Saura and F.J. Vazquez.2004.Political opinion formation in policy issues. An evolutionary approach.Computing in economics and finance series(n.28).Society for computational economics. http://repec.org/sce2004/up.9289.1075915350.pdf Terna, P.2009. The epidemic of innovation - playing around with an agent-based model.Economics of Innovation and New Technology, 18:7, 707-728. http://dx.doi.org/10.1080/10438590802564808 @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 airplane true 0 Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 box false 0 Polygon -7500403 true true 150 285 285 225 285 75 150 135 Polygon -7500403 true true 150 135 15 75 150 15 285 75 Polygon -7500403 true true 15 75 15 225 150 285 150 135 Line -16777216 false 150 285 150 135 Line -16777216 false 150 135 15 75 Line -16777216 false 150 135 285 75 bug true 0 Circle -7500403 true true 96 182 108 Circle -7500403 true true 110 127 80 Circle -7500403 true true 110 75 80 Line -7500403 true 150 100 80 30 Line -7500403 true 150 100 220 30 butterfly true 0 Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 Circle -16777216 true false 135 90 30 Line -16777216 false 150 105 195 60 Line -16777216 false 150 105 105 60 car false 0 Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 Circle -16777216 true false 180 180 90 Circle -16777216 true false 30 180 90 Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 Circle -7500403 true true 47 195 58 Circle -7500403 true true 195 195 58 circle false 0 Circle -7500403 true true 0 0 300 circle 2 false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 cow false 0 Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 Polygon -7500403 true true 73 210 86 251 62 249 48 208 Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 cylinder false 0 Circle -7500403 true true 0 0 300 dot false 0 Circle -7500403 true true 90 90 120 face happy false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 face neutral false 0 Circle -7500403 true true 8 7 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Rectangle -16777216 true false 60 195 240 225 face sad false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 fish false 0 Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 Circle -16777216 true false 215 106 30 flag false 0 Rectangle -7500403 true true 60 15 75 300 Polygon -7500403 true true 90 150 270 90 90 30 Line -7500403 true 75 135 90 135 Line -7500403 true 75 45 90 45 flower false 0 Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 Circle -7500403 true true 85 132 38 Circle -7500403 true true 130 147 38 Circle -7500403 true true 192 85 38 Circle -7500403 true true 85 40 38 Circle -7500403 true true 177 40 38 Circle -7500403 true true 177 132 38 Circle -7500403 true true 70 85 38 Circle -7500403 true true 130 25 38 Circle -7500403 true true 96 51 108 Circle -16777216 true false 113 68 74 Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 house false 0 Rectangle -7500403 true true 45 120 255 285 Rectangle -16777216 true false 120 210 180 285 Polygon -7500403 true true 15 120 150 15 285 120 Line -16777216 false 30 120 270 120 leaf false 0 Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 line true 0 Line -7500403 true 150 0 150 300 line half true 0 Line -7500403 true 150 0 150 150 pentagon false 0 Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 person false 0 Circle -7500403 true true 110 5 80 Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 Rectangle -7500403 true true 127 79 172 94 Polygon -7500403 true true 195 90 240 150 225 180 165 105 Polygon -7500403 true true 105 90 60 150 75 180 135 105 person business false 0 Rectangle -1 true false 120 90 180 180 Polygon -13345367 true false 135 90 150 105 135 180 150 195 165 180 150 105 165 90 Polygon -7500403 true true 120 90 105 90 60 195 90 210 116 154 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 183 153 210 210 240 195 195 90 180 90 150 165 Circle -7500403 true true 110 5 80 Rectangle -7500403 true true 127 76 172 91 Line -16777216 false 172 90 161 94 Line -16777216 false 128 90 139 94 Polygon -13345367 true false 195 225 195 300 270 270 270 195 Rectangle -13791810 true false 180 225 195 300 Polygon -14835848 true false 180 226 195 226 270 196 255 196 Polygon -13345367 true false 209 202 209 216 244 202 243 188 Line -16777216 false 180 90 150 165 Line -16777216 false 120 90 150 165 plant false 0 Rectangle -7500403 true true 135 90 165 300 Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 square false 0 Rectangle -7500403 true true 30 30 270 270 square 2 false 0 Rectangle -7500403 true true 30 30 270 270 Rectangle -16777216 true false 60 60 240 240 star false 0 Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 target false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 Circle -7500403 true true 60 60 180 Circle -16777216 true false 90 90 120 Circle -7500403 true true 120 120 60 tree false 0 Circle -7500403 true true 118 3 94 Rectangle -6459832 true false 120 195 180 300 Circle -7500403 true true 65 21 108 Circle -7500403 true true 116 41 127 Circle -7500403 true true 45 90 120 Circle -7500403 true true 104 74 152 triangle false 0 Polygon -7500403 true true 150 30 15 255 285 255 triangle 2 false 0 Polygon -7500403 true true 150 30 15 255 285 255 Polygon -16777216 true false 151 99 225 223 75 224 truck false 0 Rectangle -7500403 true true 4 45 195 187 Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 Rectangle -1 true false 195 60 195 105 Polygon -16777216 true false 238 112 252 141 219 141 218 112 Circle -16777216 true false 234 174 42 Rectangle -7500403 true true 181 185 214 194 Circle -16777216 true false 144 174 42 Circle -16777216 true false 24 174 42 Circle -7500403 false true 24 174 42 Circle -7500403 false true 144 174 42 Circle -7500403 false true 234 174 42 turtle true 0 Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 wheel false 0 Circle -7500403 true true 3 3 294 Circle -16777216 true false 30 30 240 Line -7500403 true 150 285 150 15 Line -7500403 true 15 150 285 150 Circle -7500403 true true 120 120 60 Line -7500403 true 216 40 79 269 Line -7500403 true 40 84 269 221 Line -7500403 true 40 216 269 79 Line -7500403 true 84 40 221 269 x false 0 Polygon -7500403 true true 270 75 225 30 30 225 75 270 Polygon -7500403 true true 30 75 75 30 270 225 225 270 @#$#@#$#@ NetLogo 4.0.4 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@