breed [honors ] breed [trusters ] breed [vengefuls ] breed [apathetics ] turtles-own [ energy chancebreed energylastturn partner pedigree coupled? partnerbreed previouscouple previouscounter stillness oldx oldy ] globals[ chanceturn smartbreed chancesmart chanceheritability expectedhonorsred expectedtrustersred expectedvengefulsred expectedapatheticsred expectedhonorspink expectedtrusterspink expectedvengefulspink expectedapatheticspink expectedhonorsgreen expectedtrustersgreen expectedvengefulsgreen expectedapatheticsgreen expectedhonorsyellow expectedtrustersyellow expectedvengefulsyellow expectedapatheticsyellow smartgreen smartyellow smartpink smartred noallele oneallele twoallele lowermiddle uppermiddle top t2r turn smartness heritability ] to go if ticks >= 300 [ stop ] ;; multiply the number of how often you want data recored by this number move-turtles couple encounter-turtles reproduce check-death do-plots if turn < 100 [ set turn turn + 1 go] if turn > 99 [set turn 0 tick] end to setup clear-all setup-patches set turn 0 create-honors numberhonors [ set color blue set shape "person" set size .5] ask honors [ setxy random-xcor random-ycor set energy random 15 set coupled? false set partner nobody set previouscouple false set previouscounter 0 set stillness 0 set pedigree "originalhonors"] create-trusters numbertrusters [ set color orange set shape "person" set size .5] ask trusters [ setxy random-xcor random-ycor set energy random 15 set coupled? false set partner nobody set previouscouple false set previouscounter 0 set stillness 0 set pedigree "originaltrusters"] create-vengefuls numbervengefuls [ set color magenta set shape "person" set size .5 ] ask vengefuls [ setxy random-xcor random-ycor set energy random 15 set coupled? false set partner nobody set previouscouple false set previouscounter 0 set stillness 0 set pedigree "originalvengefuls"] create-apathetics numberapathetics [ set color grey set shape "person" set size .5 ] ask apathetics [ setxy random-xcor random-ycor set energy random 15 set coupled? false set partner nobody set previouscouple false set previouscounter 0 set stillness 0 set pedigree "originalapathetics"] set heritability precision (.6 + random-float .4) 2 ; set smartness 0 ;; set the heritability set chanceheritability 100 set noallele round ((heritability * heritability) * 100) set oneallele round ((heritability * (1 - heritability)) * 100) set twoallele (1 - heritability) * (1 - heritability) * 100 set lowermiddle noallele + oneallele set uppermiddle (noallele + oneallele + oneallele) if automatic-error? = true [ ;;set error set t1 precision (random-float .15) 2 set t2 precision (random-float .15) 2 ] set t2r ( 1 - t2 );here the chance of attacking a cheater, useful because what the below calculates is the chance of attack, not error set e1 precision ((1 - (1 - t1) * (1 - t1))) 2 ;honor or honor attacks set e2 t1 ; honor attacks dignity set e3 precision (1 - ((1 - t1) * (1 - t2r))) 2 ; honor or vengeful attacks set e4 t1 ; honor attacks passive, note appeasement set e5 t1 ; honor attacks dignity - so there is a chance that law punishes honor set e6 0 ; dignity attacks dignity - neither is violent set e7 t1 ; vengeful attacks dignity - dignity is nonviolent - so there is a chance that law punishes set e8 0 ; dignity attcks passive - neither is violent set e9 precision (1 - ((1 - t1) * (1 - t2r))) 2 ; honor or vengeful attacks set e10 t1 ; vengeful attacks dignity (note that this exists only in case vengeful falsely attacks) set e11 (1 - ((1 - t2r) * (1 - t2r))) ; either or both vengefuls attack set e12 t1 ; vengeful attacks passive set e13 t1 ; honor attacks passive - passive is nonviolent, but chance that law punishes honor set e14 0 ; passive attacks dignity - neither is violent set e15 t1 ; vengeful attacks passive - passive is nonviolent, but chance that law punishes vengeful set e16 0 ; passive attcks passive - neither is violent ;; set the payoff matrix if automatic-payoffs? = true [ set Base (precision (random-float .25) 2) set C (precision (random-float 1) 2 ) set P (precision (random-float 1) 2) set R (precision (random-float 1) 2) if P < R or P < C or R < C [ repeat 1 [setup]] set A (precision (.01 + random-float .98) 2) set F (precision (3 - random-float 2) 2) ] ;; HH TH VH AH ;; HT TT VT AT ;; HV TV VV AV ;; HA TA VA AA set HH precision (Base + C - (e1 * F * P) - (e1 * L * P)) 2 ;B+C-e1fp-e1lp set TH precision (Base + C - (e2 * P)) 2 ;B+C-e2p set VH precision (Base - (e3 * F * P) - (e3 * L * P) + (t2 * R)) 2 ;B-e3fp-e3lp + t2*r ; t2*r indicates that when honor fails to detect the cheat, vengeful gets something set AH precision (Base + A * C - e4 * P) 2 ;B+ac-e4p set H_T precision (Base + C - (e5 * L * P)) 2 ; B + c - e5lp set TT precision (Base + C) 2 ;B + c set VT precision (Base + R - (e7 * L * P)) 2 ;B + r - e7lp set AT precision (Base + R) 2 ;B + r set HV precision (Base - (e9 * F * P) - (e9 * L * P) - (t2 * R) ) 2 ;B - e9fp - e9lp - t2*r ; t2*r indicates that when honor fails to detect the cheat, vengeful gets something set TV precision (Base - R - (e10 * P)) 2 ;B - r - e10p set VV precision (Base - (e11 * F * P) - (e11 * L * P)) 2 ;B - e11fp - e11lp set AV precision (Base - (A * R) - (e12 * P)) 2 ;B - ar -e12p set HA precision (Base + (A * C) - (e13 * L * P)) 2 ;B + ac - e13lp set TA precision (Base - R) 2 ;B - r set VA precision (Base + (A * R) - (e15 * L * P)) 2 ;B + ar - e15lp set AA precision (Base) 2 ;B set HH precision (HH) 2 set H_T precision (H_T) 2 set HV precision (HV) 2 set HA precision (HA) 2 set HV precision (HV) 2 set TH precision (TH) 2 set TT precision (TT) 2 set TV precision (TV) 2 set TA precision (TA) 2 set VH precision (VH) 2 set VT precision (VT) 2 set VV precision (VV) 2 set VA precision (VA) 2 set AH precision (AH) 2 set AT precision (AT) 2 set AV precision (AV) 2 set AA precision (AA) 2 end to setup-patches ask patches[ if pxcor > 1 and pycor > 1 and pxcor < 24 and pycor < 24 [ set pcolor green ] if pxcor > 1 and pycor < -1 and pxcor < 24 and pycor > -24 [ set pcolor red ] if pxcor < -1 and pycor > 1 and pxcor > -24 and pycor < 24 [ set pcolor yellow ] if pxcor < -1 and pycor < -1 and pxcor > -24 and pycor > -24 [ set pcolor pink ] if pxcor <= 1 and pxcor >= -1 [set pcolor black] if pycor <= 1 and pycor >= -1 [set pcolor black] if (pxcor >= 24) or (pxcor <= -24) [set pcolor black] if (pycor >= 24) or (pycor <= -24) [set pcolor black] ] end to move-turtles ask turtles [ if breed = honors [ set color blue] if breed = trusters [ set color orange] if breed = vengefuls [ set color violet] if breed = apathetics [ set color gray] ] ask turtles [set partnerbreed false set coupled? false set partner nobody] ask turtles [ set chanceturn (random 10 + 1) set oldx xcor set oldY ycor if energy > energylastturn [ forward 0 ] if energy = energylastturn and chanceturn > 5 [ right random 22 forward 1 ] if energy = energylastturn and chanceturn <= 5 [ left random 22 forward 1 ] if energy < energylastturn [ right random 360 forward 3 ] if oldx = xcor and oldy = ycor[ set stillness stillness + 1] if stillness > 9.9 [ right random 360 forward 3 set stillness 0 ] set energylastturn energy if previouscounter > .99 [set previouscounter 0] if previouscouple = true [set previouscounter 1 set previouscouple false] ] end ;;partnering up each turn to couple ask turtles[ if any? other turtles-here [ if coupled? != true and previouscounter < 1 [ set partner one-of other turtles-here with [coupled? = false and previouscounter < 1] if partner != nobody [ set partnerbreed [breed] of partner set previouscouple true set coupled? true ask partner [ set coupled? true] ask partner [ set partner myself ] ask partner[ set partnerbreed [breed] of myself] ask partner[ set previouscouple true] ] ] ] ] end to encounter-turtles ask turtles [ if coupled? = true and pcolor != black and previouscounter < 1 [ ;;rules for honors ask self [ if breed = honors [ if partnerbreed = honors [ set energy (energy + HH) ] if partnerbreed = trusters [ set energy (energy + H_T) ] if partnerbreed = vengefuls [ set energy (energy + HV) ] if partnerbreed = apathetics [ set energy (energy + HA) ] ] ] ;;rules for trusters if breed = trusters [ if partnerbreed = honors [ set energy (energy + TH) ] if partnerbreed = trusters[ set energy (energy + TT) ] if partnerbreed = vengefuls [ set energy (energy + TV) ] if partnerbreed = apathetics [ set energy (energy + TA) ] ] ;;rules for vengefuls if breed = vengefuls [ if partnerbreed = honors [ set energy (energy + VH) ] if partnerbreed = trusters [ set energy (energy + VT) ] if partnerbreed = vengefuls [ set energy (energy + VV) ] if partnerbreed = apathetics [ set energy (energy + VA) ] ] ;;rules for apathetics if breed = apathetics [ if partnerbreed = honors [ set energy (energy + AH) ] if partnerbreed = trusters [ set energy (energy + AT) ] if partnerbreed = vengefuls [ set energy (energy + AV) ] if partnerbreed = apathetics [ set energy (energy + AA) ] ] ] ] end ;;end rules to reproduce ask turtles [ ask self[ if energy > birth-energy [ set energy 5 ;; take away birth-energy to give birth set chancesmart random 100 if chancesmart >= 100 - smartness [ if pcolor = yellow[ if smartyellow = "honors" [ hatch 1 [set breed honors set shape "person" set stillness 0 ]] if smartyellow = "trusters" [hatch 1 [set breed trusters set shape "person" set stillness 0 ]] if smartyellow = "apathetics" [hatch 1 [set breed apathetics set shape "person" set stillness 0 ]] if smartyellow = "vengefuls" [hatch 1 [set breed vengefuls set shape "person" set stillness 0 ]] ] if pcolor = green [ if smartgreen = "honors" [ hatch 1 [set breed honors set shape "person" set stillness 0 ]] if smartgreen = "trusters" [hatch 1 [set breed trusters set shape "person" set stillness 0 ]] if smartgreen = "apathetics" [hatch 1 [set breed apathetics set shape "person" set stillness 0 ]] if smartgreen = "vengefuls" [hatch 1 [set breed vengefuls set shape "person" set stillness 0 ]] ] if pcolor = red [ if smartred = "honors" [ hatch 1 [set breed honors set shape "person" set stillness 0 ]] if smartred = "trusters" [hatch 1 [set breed trusters set shape "person" set stillness 0 ]] if smartred = "apathetics" [hatch 1 [set breed apathetics set shape "person" set stillness 0 ]] if smartred = "vengefuls" [hatch 1 [set breed vengefuls set shape "person" set stillness 0 ]] ] if pcolor = pink [ if smartpink = "honors" [ hatch 1 [set breed honors set shape "person" set stillness 0 ]] if smartpink = "trusters" [hatch 1 [set breed trusters set shape "person" set stillness 0 ]] if smartpink = "apathetics" [hatch 1 [set breed apathetics set shape "person" set stillness 0 ]] if smartpink = "vengefuls" [hatch 1 [set breed vengefuls set shape "person" set stillness 0 ]] ] ] if chancesmart < 100 - smartness [ if breed = honors [ set chancebreed random 100 + 1 if chancebreed <= noallele [ hatch 1 [set breed honors set shape "person" set pedigree "hfromh" set stillness 0 ]] if chancebreed > noallele and chancebreed <= lowermiddle [hatch 1 [ set breed trusters set shape "person" set previouscounter 0 set pedigree "tfromh" set stillness 0 ]] if chancebreed > lowermiddle and chancebreed <= uppermiddle [hatch 1 [ set breed vengefuls set shape "person" set previouscounter 0 set pedigree "vfromh" set stillness 0 ]] if chancebreed > uppermiddle [hatch 1 [ set breed apathetics set shape "person" set previouscounter 0 set pedigree "afromh" set stillness 0 ]] ] if breed = trusters [ set chancebreed random 100 + 1 if chancebreed <= noallele [ hatch 1 [set breed trusters set shape "person" set previouscounter 0 set pedigree "tfromt" set stillness 0 ]] if chancebreed > noallele and chancebreed <= lowermiddle [hatch 1 [ set breed honors set shape "person" set previouscounter 0 set pedigree "hfromt" set stillness 0 ]] if chancebreed > lowermiddle and chancebreed <= uppermiddle [hatch 1 [ set breed apathetics set shape "person" set previouscounter 0 set pedigree "afromt" set stillness 0 ]] if chancebreed > uppermiddle [hatch 1 [ set breed vengefuls set shape "person" set previouscounter 0 set pedigree "vfromt" set stillness 0 ]] ] if breed = vengefuls [ set chancebreed random 100 + 1 if chancebreed <= noallele [ hatch 1 [set breed vengefuls set shape "person" set previouscounter 0 set pedigree "vfromv" set stillness 0 ]] if chancebreed > noallele and chancebreed <= lowermiddle [hatch 1 [ set breed apathetics set shape "person" set previouscounter 0 set pedigree "afromv" set stillness 0 ]] if chancebreed > lowermiddle and chancebreed <= uppermiddle [hatch 1 [ set breed honors set shape "person" set previouscounter 0 set pedigree "hfromv" set stillness 0 ]] if chancebreed > uppermiddle [hatch 1 [ set breed trusters set shape "person" set previouscounter 0 set pedigree "tfromv" set stillness 0 ]] ] if breed = apathetics [ set chancebreed random 100 + 1 if chancebreed <= noallele [ hatch 1 [set breed apathetics set shape "person" set previouscounter 0 set pedigree "afroma" set stillness 0 ]] if chancebreed > noallele and chancebreed <= lowermiddle [hatch 1 [ set breed trusters set shape "person" set previouscounter 0 set pedigree "tfroma" set stillness 0 ]] if chancebreed > lowermiddle and chancebreed <= uppermiddle [hatch 1 [ set breed vengefuls set shape "person" set previouscounter 0 set pedigree "vfroma" set stillness 0 ]] if chancebreed > uppermiddle [hatch 1 [ set breed honors set shape "person" set previouscounter 0 set pedigree "hfroma" set stillness 0 ]] ] ] ] ] ] end to check-death ask turtles [ if energy <= 0 [ die ] ;; removes the turtle if it has no energy left ] if count turtles > 5000 [ let difference (count turtles) - 5000 ask n-of difference turtles [die] ] end to do-plots set-current-plot "Totals" ;; which plot we want to use next set-current-plot-pen "Honors" ;; which pen we want to use next plot count honors ;; what will be plotted by the current pen set-current-plot-pen "Trusters" ;; which pen we want to use next plot count trusters ;; what will be plotted by the current pen set-current-plot-pen "Vengefuls" ;; which pen we want to use next plot count Vengefuls ;; what will be plotted by the current pen set-current-plot-pen "Apathetics" ;; which pen we want to use next plot count apathetics ;; what will be plotted by the current pen if smartness > 0 [ ;;Smartest on Plots ;;red smartness set expectedhonorsred (HH * count honors with [pcolor = red] ) + (H_T * count trusters with [pcolor = red]) + (HV * count vengefuls with [pcolor = red]) + (HA * count apathetics with [pcolor = red]) set expectedtrustersred (TH * count honors with [pcolor = red]) + (TT * count trusters with [pcolor = red]) + (TV * count vengefuls with [pcolor = red]) + (TA * count apathetics with [pcolor = red]) set expectedvengefulsred (VH * count honors with [pcolor = red]) + (VT * count trusters with [pcolor = red]) + (VV * count vengefuls with [pcolor = red]) + (AV * count apathetics with [pcolor = red]) set expectedapatheticsred (AH * count honors with [pcolor = red]) + (AT * count trusters with [pcolor = red]) + (AV * count vengefuls with [pcolor = red]) + (AA * count apathetics with [pcolor = red]) if expectedhonorsred > expectedtrustersred and expectedhonorsred > expectedvengefulsred and expectedhonorsred > expectedapatheticsred[ set smartred "honors"] if expectedtrustersred > expectedhonorsred and expectedtrustersred > expectedvengefulsred and expectedtrustersred > expectedapatheticsred[ set smartred "trusters"] if expectedvengefulsred > expectedtrustersred and expectedvengefulsred > expectedhonorsred and expectedvengefulsred > expectedapatheticsred[ set smartred "vengefuls"] if expectedapatheticsred > expectedtrustersred and expectedapatheticsred > expectedvengefulsred and expectedapatheticsred > expectedhonorsred[ set smartred "apathetics"] ;;yellow smartness set expectedhonorsyellow (HH * count honors with [pcolor = yellow] ) + (H_T * count trusters with [pcolor = yellow]) + (HV * count vengefuls with [pcolor = yellow]) + (HA * count apathetics with [pcolor = yellow]) set expectedtrustersyellow (TH * count honors with [pcolor = yellow]) + (TT * count trusters with [pcolor = yellow]) + (TV * count vengefuls with [pcolor = yellow]) + (TA * count apathetics with [pcolor = yellow]) set expectedvengefulsyellow (VH * count honors with [pcolor = yellow]) + (VT * count trusters with [pcolor = yellow]) + (VV * count vengefuls with [pcolor = yellow]) + (AV * count apathetics with [pcolor = yellow]) set expectedapatheticsyellow (AH * count honors with [pcolor = yellow]) + (AT * count trusters with [pcolor = yellow]) + (AV * count vengefuls with [pcolor = yellow]) + (AA * count apathetics with [pcolor = yellow]) if expectedhonorsyellow > expectedtrustersyellow and expectedhonorsyellow > expectedvengefulsyellow and expectedhonorsyellow > expectedapatheticsyellow[ set smartyellow "honors"] if expectedtrustersyellow > expectedhonorsyellow and expectedtrustersyellow > expectedvengefulsyellow and expectedtrustersyellow > expectedapatheticsyellow[ set smartyellow "trusters"] if expectedvengefulsyellow > expectedtrustersyellow and expectedvengefulsyellow > expectedhonorsyellow and expectedvengefulsyellow > expectedapatheticsyellow[ set smartyellow "vengefuls"] if expectedapatheticsyellow > expectedtrustersyellow and expectedapatheticsyellow > expectedvengefulsyellow and expectedapatheticsyellow > expectedhonorsyellow[ set smartyellow "apathetics"] ;;pink smartness set expectedhonorspink (HH * count honors with [pcolor = pink] ) + (H_T * count trusters with [pcolor = pink]) + (HV * count vengefuls with [pcolor = pink]) + (HA * count apathetics with [pcolor = pink]) set expectedtrusterspink (TH * count honors with [pcolor = pink]) + (TT * count trusters with [pcolor = pink]) + (TV * count vengefuls with [pcolor = pink]) + (TA * count apathetics with [pcolor = pink]) set expectedvengefulspink (VH * count honors with [pcolor = pink]) + (VT * count trusters with [pcolor = pink]) + (VV * count vengefuls with [pcolor = pink]) + (AV * count apathetics with [pcolor = pink]) set expectedapatheticspink (AH * count honors with [pcolor = pink]) + (AT * count trusters with [pcolor = pink]) + (AV * count vengefuls with [pcolor = pink]) + (AA * count apathetics with [pcolor = pink]) if expectedhonorspink > expectedtrusterspink and expectedhonorspink > expectedvengefulspink and expectedhonorspink > expectedapatheticspink[ set smartpink "honors"] if expectedtrusterspink > expectedhonorspink and expectedtrusterspink > expectedvengefulspink and expectedtrusterspink > expectedapatheticspink[ set smartpink "trusters"] if expectedvengefulspink > expectedtrusterspink and expectedvengefulspink > expectedhonorspink and expectedvengefulspink > expectedapatheticspink[ set smartpink "vengefuls"] if expectedapatheticspink > expectedtrusterspink and expectedapatheticspink > expectedvengefulspink and expectedapatheticspink > expectedhonorspink[ set smartpink "apathetics"] ;;green smartness set expectedhonorsgreen (HH * count honors with [pcolor = green] ) + (H_T * count trusters with [pcolor = green]) + (HV * count vengefuls with [pcolor = green]) + (HA * count apathetics with [pcolor = green]) set expectedtrustersgreen (TH * count honors with [pcolor = green]) + (TT * count trusters with [pcolor = green]) + (TV * count vengefuls with [pcolor = green]) + (TA * count apathetics with [pcolor = green]) set expectedvengefulsgreen (VH * count honors with [pcolor = green]) + (VT * count trusters with [pcolor = green]) + (VV * count vengefuls with [pcolor = green]) + (AV * count apathetics with [pcolor = green]) set expectedapatheticsgreen (AH * count honors with [pcolor = green]) + (AT * count trusters with [pcolor = green]) + (AV * count vengefuls with [pcolor = green]) + (AA * count apathetics with [pcolor = green]) if expectedhonorsgreen > expectedtrustersgreen and expectedhonorsgreen > expectedvengefulsgreen and expectedhonorsgreen > expectedapatheticsgreen[ set smartgreen "honors"] if expectedtrustersgreen > expectedhonorsgreen and expectedtrustersgreen > expectedvengefulsgreen and expectedtrustersgreen > expectedapatheticsgreen[ set smartgreen "trusters"] if expectedvengefulsgreen > expectedtrustersgreen and expectedvengefulsgreen > expectedhonorsgreen and expectedvengefulsgreen > expectedapatheticsgreen[ set smartgreen "vengefuls"] if expectedapatheticsgreen > expectedtrustersgreen and expectedapatheticsgreen > expectedvengefulsgreen and expectedapatheticsgreen > expectedhonorsgreen[ set smartgreen "apathetics"] ] end @#$#@#$#@ GRAPHICS-WINDOW 341 10 580 270 25 25 4.5 1 10 1 1 1 0 1 1 1 -25 25 -25 25 1 1 1 ticks CC-WINDOW 5 792 1066 887 Command Center 0 BUTTON 12 10 96 43 NIL setup NIL 1 T OBSERVER NIL R NIL NIL BUTTON 99 10 176 43 Go go T 1 T OBSERVER NIL K NIL NIL MONITOR 215 56 337 101 Total Count count turtles 3 1 11 SLIDER 302 182 335 379 birth-energy birth-energy 0 50 15 1 1 NIL VERTICAL PLOT 350 314 651 464 Totals time totals 0.0 10.0 0.0 10.0 true true PENS "Honors" 1.0 0 -13345367 true "Trusters" 1.0 0 -955883 true "Vengefuls" 1.0 0 -5825686 true "Apathetics" 1.0 0 -7500403 true MONITOR 8 181 136 226 # of Honors (Blue) count honors 17 1 11 MONITOR 142 181 273 226 # of Trusters (Orange) count trusters 17 1 11 MONITOR 7 232 138 277 # of Vengefuls (Purple) count vengefuls 17 1 11 MONITOR 144 233 272 278 # of Apathetics (Grey) count apathetics 17 1 11 BUTTON 179 10 267 43 Go Once go NIL 1 T OBSERVER NIL G NIL NIL INPUTBOX 14 53 109 113 numberhonors 1204 1 0 Number INPUTBOX 111 54 206 114 numbertrusters 1204 1 0 Number INPUTBOX 13 117 109 177 numbervengefuls 1204 1 0 Number INPUTBOX 113 118 206 178 numberapathetics 1204 1 0 Number INPUTBOX 775 94 848 154 H_T 0.76 1 0 Number INPUTBOX 776 27 849 87 HH 0.55 1 0 Number INPUTBOX 776 159 849 219 HV -1.45 1 0 Number INPUTBOX 776 226 848 286 HA 0.47 1 0 Number INPUTBOX 852 28 906 88 TH 0.71 1 0 Number INPUTBOX 852 94 906 154 TT 0.76 1 0 Number INPUTBOX 852 159 907 219 TV -0.64 1 0 Number INPUTBOX 850 226 908 286 TA -0.59 1 0 Number INPUTBOX 909 28 978 88 VH -1.25 1 0 Number INPUTBOX 909 93 978 153 VT 1.01 1 0 Number INPUTBOX 912 164 978 224 VV -1.52 1 0 Number INPUTBOX 913 226 980 286 VA 0.59 1 0 Number INPUTBOX 980 29 1055 89 AH 0.43 1 0 Number INPUTBOX 983 94 1057 154 AT 1.01 1 0 Number INPUTBOX 984 162 1054 222 AV -0.22 1 0 Number INPUTBOX 984 227 1052 287 AA 0.21 1 0 Number MONITOR 213 291 296 336 Smart Yellow Smartyellow 17 1 11 MONITOR 214 338 296 383 Smart Green Smartgreen 17 1 11 MONITOR 216 385 294 430 Smart Pink SmartPink 17 1 11 MONITOR 218 434 293 479 Smart Red Smartred 17 1 11 INPUTBOX 796 325 846 385 e1 0.12 1 0 Number INPUTBOX 849 325 899 385 e2 0.06 1 0 Number INPUTBOX 797 388 847 448 e5 0.06 1 0 Number INPUTBOX 797 452 847 512 e9 0.89 1 0 Number INPUTBOX 796 514 846 574 e13 0.06 1 0 Number INPUTBOX 849 389 899 449 e6 0 1 0 Number INPUTBOX 849 453 899 513 e10 0.06 1 0 Number INPUTBOX 850 515 900 575 e14 0 1 0 Number INPUTBOX 903 325 953 385 e3 0.89 1 0 Number INPUTBOX 902 388 952 448 e7 0.06 1 0 Number INPUTBOX 904 453 954 513 e11 0.9856 1 0 Number INPUTBOX 904 516 954 576 e15 0.06 1 0 Number INPUTBOX 954 326 1004 386 e4 0.06 1 0 Number INPUTBOX 955 388 1005 448 e8 0 1 0 Number INPUTBOX 957 454 1007 514 e12 0.06 1 0 Number INPUTBOX 958 517 1008 577 e16 0 1 0 Number SWITCH 8 490 187 523 automatic-payoffs? automatic-payoffs? 0 1 -1000 TEXTBOX 804 289 1017 334 1st Letter: Who is current turtle\n2nd Letter: Who turtle encounters 12 0.0 1 INPUTBOX 675 524 730 584 t1 0.06 1 0 Number INPUTBOX 735 524 791 584 t2 0.12 1 0 Number INPUTBOX 347 473 410 533 C 0.55 1 0 Number INPUTBOX 421 472 480 532 R 0.8 1 0 Number INPUTBOX 492 471 551 531 P 0.8 1 0 Number INPUTBOX 559 473 612 533 A 0.48 1 0 Number INPUTBOX 618 472 668 532 F 2.19 1 0 Number TEXTBOX 10 530 160 560 Turn on to automatically calculate payoff values 12 0.0 1 TEXTBOX 576 541 726 571 t1: type I error\nt2: type II error 12 0.0 1 TEXTBOX 871 10 953 28 Payoff Matrix 12 0.0 1 TEXTBOX 862 578 1012 596 Error Matrix 12 0.0 1 SLIDER 671 480 793 513 L L 0 2 0 .1 1 NIL HORIZONTAL MONITOR 11 584 61 629 HfromH count turtles with [pedigree =\"hfromh\"] 17 1 11 MONITOR 65 583 115 628 HfromT count turtles with [pedigree = \"hfromt\"] 17 1 11 MONITOR 119 583 169 628 HfromV count turtles with [pedigree =\"hfromv\"] 17 1 11 MONITOR 173 584 223 629 HfromA count turtles with [pedigree =\"hfroma\"] 17 1 11 MONITOR 11 630 61 675 TfromH count turtles with [pedigree =\"tfromh\"] 17 1 11 MONITOR 11 678 61 723 VfromH count turtles with [pedigree = \"vfromh\"] 17 1 11 MONITOR 10 728 60 773 AfromH count turtles with [pedigree = \"afromh\"] 17 1 11 MONITOR 65 630 115 675 TfromT count turtles with [pedigree = \"tfromt\"] 17 1 11 MONITOR 65 679 115 724 VfromT count turtles with [pedigree = \"vfromt\"] 17 1 11 MONITOR 65 729 115 774 AfromT count turtles with [pedigree = \"afromt\"] 17 1 11 MONITOR 119 633 169 678 TfromV count turtles with [pedigree =\"tfromv\"] 17 1 11 MONITOR 119 680 169 725 VfromV count turtles with [pedigree = \"vfromv\"] 17 1 11 MONITOR 119 730 169 775 AfromV count turtles with [pedigree = \"afromv\"] 17 1 11 MONITOR 174 634 224 679 TfromA count turtles with [pedigree =\"tfroma\"] 17 1 11 MONITOR 173 682 223 727 VfromA count turtles with [pedigree = \"vfroma\"] 17 1 11 MONITOR 174 731 224 776 AfromA count turtles with [pedigree = \"afroma\"] 17 1 11 MONITOR 422 587 491 632 NIL Uppermiddle 17 1 11 MONITOR 347 585 415 630 NIL lowermiddle 17 1 11 MONITOR 346 537 417 582 NIL heritability 17 1 11 MONITOR 422 537 484 582 NIL oneallele 17 1 11 MONITOR 488 537 545 582 NIL noallele 17 1 11 MONITOR 234 584 331 629 Original Honors count turtles with [pedigree =\"originalhonors\"] 17 1 11 MONITOR 234 634 332 679 Original Trusters count turtles with [pedigree =\"originaltrusters\"] 17 1 11 MONITOR 233 685 332 730 Original Vengefuls count turtles with [pedigree =\"originalvengefuls\"] 17 1 11 MONITOR 233 733 332 778 Original Apathetics count turtles with [pedigree =\"originalapathetics\"] 17 1 11 TEXTBOX 95 561 168 582 Pedigree 17 0.0 1 MONITOR 24 440 81 489 NIL turn 17 1 12 SWITCH 189 488 337 521 automatic-error? automatic-error? 0 1 -1000 INPUTBOX 292 524 342 584 Base 0.21 1 0 Number MONITOR 202 531 285 576 NIL chancesmart 17 1 11 @#$#@#$#@ Honor, Trust, Diginity, and Apathetic Cultures (breeds) People's resources are called "energy" Everyone starts at a random location on the map with an initial energy level of 100 As people interact with one another they either gain or lose energy. When their energy surpasses the "birth-energy" level," they reproduce Reproduction of one allele occurs at the level set for heritability Smartness is the probability that when a person reproduces, their offspring will be of the breed that currently has the highest expected value. C < R < P P varies from 0 to 1000 R is less than P C is less than R A < 1 1 < F < 3 T1: type 1 error T2: type 2 error Errors are .10 by default Law enforcement is .10 by default (10% of the time, an infraction will go punished ----------- @#$#@#$#@ 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 farmer false 0 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 Polygon -1 true false 60 195 90 210 114 154 120 195 180 195 187 157 210 210 240 195 195 90 165 90 150 105 150 150 135 90 105 90 Circle -7500403 true true 110 5 80 Rectangle -7500403 true true 127 79 172 94 Polygon -13345367 true false 120 90 120 180 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 180 90 172 89 165 135 135 135 127 90 Polygon -6459832 true false 116 4 113 21 71 33 71 40 109 48 117 34 144 27 180 26 188 36 224 23 222 14 178 16 167 0 Line -16777216 false 225 90 270 90 Line -16777216 false 225 15 225 90 Line -16777216 false 270 15 270 90 Line -16777216 false 247 15 247 90 Rectangle -6459832 true false 240 90 255 300 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.5 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ setup go count honors count trusters count vengefuls count apathetics C R P A F t1 t2 heritability smartness setup go count honors count trusters count vengefuls count apathetics C R P A F t1 t2 heritability smartness @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 1.0 0.0 0.0 1 1.0 0.0 0.2 0 1.0 0.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@