; v15d ; answering MABS reviews: neo-evolution. Choice between top-score (same as in versions previous to 15d) or the new one that only takes into account the last score ; ; v15c ; in version c i check activation twice, before and after gossiping ; and I added the gossip-always? flag. ; version b bugged in decide - data unusable ; TODO:check gossipers variance error! ; changed the content of gossip: only useful info, that is, info about the present (freshly formed) group. ; changed the moment of the gossip: it goes before acting, after the group formation. ; modified active? management for gossipers: it makes no sense to carry on the old grudge (the active state) when they can see the new group. ; They defect now if there are many bad images in the NEW group not the old one. New procedure update-active-state. For MG, it will influence action and gossip; for NG gossip only ; modified observe-and-update so that from this version, gossipers take note of the non-cooperators even if they aren't enough to get them active. ; note that v14 has never been completed. We deemed more important to implement Diana's suggestion of group shifting that we call the strategy compare-1. ; compare-1 is a strategy where the gossipers, after being assigned to a group, check another group at random and change group if that one is better (in term of reputation). ; The procedures decide and create-groups have been totally rewritten to districate them and assign clearer responsiblities. ; now decide only makes the C/D choice while create-groups contains the extra complexity of our several assorts. ;v14a - unreleased ; removed bug in poor-goon (if there are zero sized groups and assort, then if you go to an empty group, noone comes back). ;introducing two new assorts: leader with reply and leader. ; the leader chooses available agents to fill its group starting with those in good standing in its list. ; leader ignores the group-keep-size flag. ;TODO ;the leader with reply does the same but the chosen agent has the right to refuse after considering the call, on the base of the leader's reputation (NOT ; on the base of the others rep as that would be computationally unfeasible.) ; what happens if a leader with reply doesn't find enough people to fill the group? ;v13 ; added a new strategy for gossiper: it is called assort. ; an active gossiper would choose an agent at random and exchange place with him before going to actually play (the play is then managed just like in refuse) ; I am using the variables my-defections.. and total-defections.. also to register the new assort. ; note: I'm not using the "skipped turn" here. SO they can jump at every turn. ; we need a measure of how this strategy would differ from the simple random. So, what we measure is: a kind of momentum.. I propose ; sum of ( squared ( group % of gossipers - its mean overall) ). It's a kind of variance; if all the gossipers are in the same group, it will be much higher. ; todo: save variance. But! at first sight it doesn't look different at all. Ouch. ;v12 ; group size can be maintened constant ; saving also the number of gossips! ;v11 ; saving the number of gossip-caused defections and (more important) refusals: new functions num-of-refusals and num-of-defections-by-gossip ;v10 ; we add death of agents whose score goes under 1 ; we also add an endowment, initial score that helps keeping agents alive if they get a few punishment in the first turns (worse case: score + 3 from public game, ; -5 * punishers from punishment, in groups of 50 we approximate 10 punishments, -50) ; thus we should check endow 50 and maybe 10. ; now we have to populate the groups.. how to do it? Keeping the same num of groups (changing then their population) or trying to keep them filled? ; let's try to keep the number of groups. Beware of variance ;- line of usability ^^^usable results above^^^ ||| NOT usable results below ||| ;- ||| ||| vvv vvv ;v09 rethinking evolution and aiming to shorter runs ; we simply rethink evolution by removing it. ; added total-punishments ; here, agents can contribute also if they have a negative score. It is as if agents 0 is only a threshold for punishment (they stop punishing under that) but ; it is not a threshold under which they stop cooperating. ; found a bug: evolution creates a niche of morituri, the new born start at zero and are bound to be chosen for elimination at next step, again and again. ; v08 introduced num of gossips per agent ; note that in version 7 reproduction trasmitted also the informational state. From v8 on, we try not transmitting it. ; v072 removed extensions array profiler ; v07 nasty bug removed (inverted C and D) ; removed opt-out as a confusing name ; added reporters for easy saving ; v05 changing proportions; removed bug with double assignment of bad images ; v04 corrected bug in reproduction (people carried on wealth from their parents). ;v03 added beta and new mixing mechanism (refute group) ;v02 new mechanisms ;1 while Number of Timesteps do 2 Random group formation of the population; 3 Agents take First Stage decision ; 4 Gather and Distribution of the Public good in each group; 5 First Stage Decisions are made public within the group; 6 Agents make Second Stage decision; 7 Punishment Execution; 8 Evolutionary Process; 9 end ;v01 globals [ types cost-of-coop total-gossips n-agents n-groups total-refusals ; these remember also the refusals and defections of the Dead. total-defections-by-gossip total-punishments total-shifts version logging-agents ] breed [groups group] groups-own [my-agents group-performance wacky? ; the wacky group is the one with the wrong size. ] breed [agents agent] agents-own [ my-group agent-type my-move my-score active? my-bad-images skipped-turn? my-refusals refusing? ; same as above but only for this turn. Used by both assort and refuse. my-defections-by-gossip ;decided? removed in v15 my-shifts ;group shifts for compare-1 shifting? current-score ] turtles-own [ ] ;-----------SETUP--------------------------------------------------------------------------------------------- to setup clear-all reset-ticks set version "15d" set cost-of-coop 1 set total-gossips 0 set total-punishments 0 set total-refusals 0 set total-defections-by-gossip 0 set types (list "C" "TFT" "MP" "NP" "FR" "NG" "MG") ;set types (list "C" "TFT" "NG" "MG" "FR") ;random-seed 34 ;foreach types [print (word "create-agents n-" ? " [set agent-type " ? "]")] foreach types [run (word "create-agents n-" ? " [set agent-type \"" ? "\"]")] ask agents [setup-agent] set n-groups ceiling (count agents / ag-per-group) ;if (round n-groups) != (count agents / ag-per-group) [print "only exact groups please" stop] create-groups n-groups [set wacky? false] set-default-shape turtles "circle" ;set logging-agents n-of 2 agents with [is-gossiper?] end to setup-agent ; only those to be cleaned after hatch. Must not clear the group. set my-score endowment set current-score 0 set my-move "" set active? false set my-bad-images no-turtles set n-agents count agents set skipped-turn? false set my-refusals 0 set my-defections-by-gossip 0 ;set decided? false set refusing? false set my-shifts 0 set shifting? false end ;to setup-panet ; ;setup-common ; ; crt 1 [setup-agent hatch 1 [setxy random-xcor random-ycor create-link-with myself ]] ; ; repeat n-agents - 2 [ ; let t2 find-partner ; crt 1 [setup-agent create-link-with t2 ] ; ] ; while [(n-links * n-agents) >= count links] [ ; let t2 find-partner ; ask one-of turtles with [not link-neighbor? t2 and not (t2 = self)] [create-link-with t2] ; ] ; ; ;layout-radial turtles links (turtle 0) ; ; ;layout ; ;end ;-----------RUN RUN RUN-SEE SPOT RUN--------------------------------------------------------------------------------------------- ;1 while Number of Timesteps do 2 Random group formation of the population; 3 Agents take First Stage decision ; 4 Gather and Distribution of the Public good in each group; 5 First Stage Decisions are made public within the group; ;6 Agents make Second Stage decision; 7 Punishment Execution; 8 Evolutionary Process; 9 end to go ; if (round n-groups) != (count agents / ag-per-group) [print "only exact groups please" stop] ; if max (map [count agents with [agent-type = ?]] types) = n-agents [ ; export-world filename behaviorspace-run-number ; stop ; ] create-the-groups ask agents [set refusing? false] ;??? decide ;while [any? agents with [not decided?]][ ask agents with [not decided?] [decide]] ;second turn of decision for those who have been displaced by assort. ask groups with [any? my-agents][public-good-play] ; this is the public good ask groups with [any? my-agents][observe-and-update]; 5 First Stage Decisions are made public within the group; agents will change from the passive to the active state once 20% of free-riders are identified within their group). ask groups with [any? my-agents][take-responsibility];6 Agents make Second Stage decision; 7 Punishment Execution if evolve? [make-evolve]; 8 Evolutionary Process; 9 end ; here we kill the poor ask agents with [my-score < 0][die] do-plots ;create-the-groups tick end to make-evolve let we-go-away count turtles * 0.08 ifelse evolution-how = "tot-score" [ ask min-n-of we-go-away agents [my-score] [die] ask n-of we-go-away agents [hatch 1 ] ][ ; only on last score. ask min-n-of we-go-away agents [current-score] [die] ask n-of we-go-away agents [hatch 1 ] ] ;note that the last-score evolution favours the free riders (their last score is always comparatively good as they never pay cooperation cost) . ;the cooperation bifurcation at G25MM is lost with last-score. end to observe-and-update let cheaters my-agents with [my-move = "D"] let cheaters-count count cheaters let agents-in-group count my-agents ask my-agents with [(member? agent-type ["TFT" "MP" "NP"] ) ] [ ; only non-gossipers become active as a consequence of play. ifelse (cheaters-count - ifelse-value (my-move = "D")[1][0]) / agents-in-group > alpha [set active? true] [set active? false] ] ask my-agents with [is-gossiper? ][set my-bad-images (turtle-set my-bad-images other cheaters) ] ; bad images grow with experience. Observation happens always since v15 (until v14 we only observed when active). end to group-remix-keeping-size while [count agents with [my-group = nobody] > ag-per-group] [ ;show count agents with [my-group = nobody] ;show [count my-agents] of groups ; v12 new operation ask one-of groups with [my-agents = no-turtles] [ ask n-of ag-per-group agents with [my-group = nobody] [set my-group myself] set my-agents agents with [my-group = myself] ] ] ; at this point only the last few agents should remain, and one or more groups. place-last-agents-in-a-smaller-group end to leader-assort while [count agents with [my-group = nobody] > ag-per-group] [ ask one-of agents with [my-group = nobody] [ ; the leader starts to act ;show (word who "-" is-gossiper?) set my-group one-of groups with [my-agents = no-turtles] ifelse (is-gossiper?) [ muster-agents-without-bad-image] [ ask n-of (ag-per-group - 1) agents with [my-group = nobody][set my-group [my-group] of myself] ] ask my-group [ set my-agents agents with [my-group = myself]] ;ask my-group [show count my-agents with [is-gossiper?]] ] ] place-last-agents-in-a-smaller-group end to update-active-state-gossiper ask agents with [is-gossiper? and not refusing?] [ set active? ifelse-value (too-many-cheaters-in my-group) [true][false] ] end to muster-agents-without-bad-image ; context: the leader. let not-blacklisted agents with [(my-group = nobody) and not (member? self [my-bad-images] of myself)] ; creates a list of agents that aren't in my blacklist let target-group my-group ifelse (count not-blacklisted >= (ag-per-group - 1)) [; I have enough of them ; ask not-blacklisted [show who] ask n-of (ag-per-group - 1) not-blacklisted [set my-group target-group] ] [ ; I don't have enough, I mix. There must be enough because of the caller. ;show "not enough whites" ask not-blacklisted [set my-group target-group] ask n-of (ag-per-group - 1 - count not-blacklisted) agents with [my-group = nobody][set my-group target-group] ] ;show ifelse-value (count agents with [my-group = target-group] = 0) [word "percent good:" 0 ] ;[word "percent good:" (count agents with [my-group = target-group] with [is-gossiper?] / count agents with [my-group = target-group])] end to place-last-agents-in-a-smaller-group if any? agents with [my-group = nobody] [ ask one-of groups with [my-agents = no-turtles] [ask agents with [my-group = nobody] [set my-group myself] set my-agents agents with [my-group = myself] set wacky? true] ] ; if there is STILL an empty group, we don't need it anymore ask groups with [my-agents = no-turtles] [die] end to create-the-groups ask agents [set my-group nobody] ask groups [set my-agents no-turtles set wacky? false] ; leader acts first. In all other cases, the groups are done first, and then there is rearrangement. ifelse (gossiper-strategy = "leader") [ ; leader management. Note how leader ignores the group-keep-size flag. leader-assort update-active-state-gossiper gossip ;End of branch leader. All the rest is in the else up to update-active-state-MG. ] [ ; in all other cases: "refuse" "defect" "assort" "leader" "compare-1" the groups are made first following the group-size flag. ifelse group-keep-size [ group-remix-keeping-size ] [ ;don't keep size; old v11 operation ask agents [set my-group one-of groups] ; beware of variance, allows for zero-sized groups, too. ask groups [set my-agents agents with [my-group = myself]] ] ; at this point we modify the "active" state of gossipers. Why? ; because gossipers - in particular, MG - should not act on the basis of their previous-step active state since they SEE the new group ; this pre-activation required for gossiping means that I gossip only as punishment; I gossip only when active. In alternative update-active-state-gossiper gossip ; then we act. note that we can use the active? flag that is set by the previous command for all gossipers. ; attention: the active state is actually that of the previous step. ; it I repeat it here, the active is considered again. Change introduced in update-active-state-gossiper ;(member? gossiper-strategy ["assort" "refuse" "compare-1"] ) [ ifelse (gossiper-strategy = "assort")[ ask agents with [is-gossiper? and not refusing? and active?] [ set my-refusals my-refusals + 1 set refusing? true set total-refusals total-refusals + 1 let to-leave my-group let to-join nobody let poor-goon nobody ask my-group [set to-join one-of other groups ] ask to-join [set poor-goon one-of my-agents] ;show to-join show poor-goon ; show [count my-agents] of to-join show [count my-agents] of to-leave if (poor-goon != nobody) [ask poor-goon [set my-group to-leave]] ; if the guy has already decided, he can choose again. ; with small groups, I might have chosen an empty group, too bad for me. set my-group to-join ; at this point the two agents think they have exchanged groups ask to-leave [set my-agents agents with [my-group = myself]] ask to-join [set my-agents agents with [my-group = myself]] ; show [count my-agents] of to-join show [count my-agents] of to-leave ] ] [ ifelse (gossiper-strategy = "refuse")[ ask agents with [is-gossiper? and not skipped-turn? and active?] [ set refusing? true let to-leave my-group set my-group nobody set skipped-turn? true ; this is reset when the agent actually plays. This turn it will skip, and won't enter here twice. set my-refusals my-refusals + 1 set total-refusals total-refusals + 1 ask to-leave [set my-agents my-agents with [my-group != nobody]] ] ] [ if (gossiper-strategy = "compare-1")[ ask agents with [is-gossiper? and active?] [ let target-group nobody ask my-group [set target-group one-of other groups] if (cheaters-ratio-in target-group < cheaters-ratio-in my-group) [ set my-shifts my-shifts + 1 set shifting? true set total-shifts total-shifts + 1 let to-leave my-group let poor-goon nobody ask target-group [set poor-goon one-of my-agents] ; nobody if the group is empty ;show to-join show poor-goon ; show [count my-agents] of to-join show [count my-agents] of to-leave if (poor-goon != nobody) [ask poor-goon [set my-group to-leave]]; with small groups, I might have chosen an empty group, too bad for me. set my-group target-group ; at this point the two agents think they have exchanged groups ask to-leave [set my-agents agents with [my-group = myself]] ask target-group [set my-agents agents with [my-group = myself]] ; show [count my-agents] of to-join show [count my-agents] of to-leave ] ] ] ] ] ] ;closing big else branch for all other cases: "refuse" "defect" "assort" "leader" "compare-1" ; log ;ask logging-agents [ask my-group [print-group] print-agents my-bad-images] ;final coherence check ask agents with [my-group = nobody and not refusing?][ show "groups creation failed!" set my-group one-of groups ] end to gossip ; after this update, there is a chance to gossip. ; reputation people if gossip? [ ask groups [ ;print-group let active-gossipers ifelse-value (gossip-always?) [my-agents with [is-gossiper?]] [my-agents with [is-gossiper? and active?]] if count active-gossipers >= 2 [ let gossipers my-agents with [is-gossiper?] let blacklisted no-turtles ask active-gossipers [ set blacklisted ([my-agents] of my-group) with [member? self [my-bad-images] of myself] if any? blacklisted [ ;type "blackisted from" type who type ": " print-agents blacklisted repeat num-of-gossips [ set total-gossips total-gossips + 1 let to-transmit one-of blacklisted ask one-of other gossipers [add-bad-image to-transmit] ] ] ] ] ] ] end to add-bad-image [a-cheater] if (a-cheater != self) [ set my-bad-images (turtle-set my-bad-images a-cheater)] end to-report old-too-many-cheaters-in [a-group] let all count other [my-agents] of a-group if all <= 0 [report false] let badguys 0 ask other [my-agents] of a-group [if member? self [my-bad-images] of myself [set badguys badguys + 1]] ifelse (badguys / all > beta) [ ;show "firing too many cheaters" report true] [ report false ] ;report ifelse-value (badguys / all > beta) [false][true] end to-report too-many-cheaters-in [a-group] report ifelse-value (cheaters-ratio-in a-group > beta) [true][false] end to-report cheaters-ratio-in [a-group] let all count other [my-agents] of a-group if all <= 0 [report 0] let badguys 0 ask other [my-agents] of a-group [if member? self [my-bad-images] of myself [set badguys badguys + 1]] report (badguys / all) end to decide ; first let's get rid of gosipers ifelse gossiper-strategy = "defect" [ ask agents with [is-gossiper?] [ ifelse (active?) [ ; active has been calculated at group formation thus it is still valid. For decide, it totally supersedes the strategy. I think that defect ; has actually lost any sense here. set my-defections-by-gossip my-defections-by-gossip + 1 set total-defections-by-gossip total-defections-by-gossip + 1 set my-move "D" ; strategy defect ;this is delicate. As they are now, defect agents become active or passive AFTER they collect the result of this game ;but BEFORE they do so, if they are in the defect strategy, they will defect if reputation tells them that there are too many cheaters. ; defect takes precedence. If gossip tells me it's a bad group, they get a D independent from my strategy. ; THEN - if I am NICE, I do C; if I am MEAN, I use my active-passive state to decide. ] [ set my-move "C" ] ] ] [ ; no defect all as usual ask agents with [is-gossiper?] [ ifelse (agent-type = "NG") ; agents of type NG always cooperate (_if_ branch) while MG agents should decide on the base of their active state if they cooperate (non-active) or defect (active). [set my-move "C"][set my-move ifelse-value active? ["D"]["C"]] ] ] ; then we can easily run all the other agents. ask agents with [member? agent-type ["NP" "C"]] [ set my-move "C" ] ; print-agents (agents with [member? agent-type ["TFT" "MP"]]) ask agents with [member? agent-type ["TFT" "MP"]] [ set my-move ifelse-value active? ["D"]["C"] ] ask agents with [agent-type = "FR"] [ set my-move "D" ] ask agents with [agent-type = "random"] [ set my-move one-of list "C" "D" ] end to public-good-play ask my-agents [set current-score ifelse-value (my-move = "C") [-1 * cost-of-coop][0]] set group-performance (count my-agents with [my-move = "C"]) * benefit let reward group-performance / (count my-agents) ;show self ;show reward ask my-agents [ set current-score current-score + reward set my-score my-score + current-score set skipped-turn? false; ;show my-score show agent-type] ] end to take-responsibility ; from v15, only punishment as gossip goes just after group formation. ; punishers let punishers my-agents with [(agent-type = "MP" or agent-type = "NP") and active?] ;show count punishers let cheaters my-agents with [my-move = "D"] ask punishers [ ask other cheaters [ if [my-score] of myself > 0 [ ; each punisher punishes all the other cheaters if he can afford it set total-punishments total-punishments + 1 set my-score my-score - punishment ask myself [set my-score my-score - cost-of-punishing] ] ] ] ; ; reputation people ; let gossipers my-agents with [is-gossiper?] ; if any? gossipers and gossip? [ ; ask gossipers with [active?] [ ; repeat num-of-gossips [ ; set total-gossips total-gossips + 1 ; let to-transmit one-of my-bad-images ; ask one-of other agents with [is-gossiper?][set my-bad-images (turtle-set my-bad-images to-transmit)] ; ] ; ] ; ] end ;-----------PLOT -and- REPORTERS -------------------------------------------------------------------------------------------- ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; ;;; Plotting Procedures ;;; ;;; ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;; to do-plots set-current-plot "populations by type" foreach types [ set-current-plot-pen ? plot count agents with [agent-type = ?] ] set-current-plot "scores by type" foreach types [ set-current-plot-pen ? if any? agents with [agent-type = ?] [ plot sum [my-score] of agents with [agent-type = ?] / count agents with [agent-type = ?] ] ] set-current-plot "gossips" plot total-gossips set-current-plot "freq of gossipers" histogram [count (my-agents with [is-gossiper?])] of groups set-current-plot "% of bad images" foreach types [ set-current-plot-pen ? if any? agents with [agent-type = ?] [ plot sum [bad-images] of (agents with [agent-type = ?]) / count agents with [agent-type = ?] ] ] set-current-plot "% of cooperations" foreach types [ set-current-plot-pen ? if any? agents with [agent-type = ?] [ plot count agents with [agent-type = ? and my-move = "C" ] / count agents with [agent-type = ?] ;map [count agents with [agent-type = ? and my-move = "C" ] / count agents with [agent-type = ?]] types ] ] set-current-plot "group performance" histogram [group-performance] of groups set-current-plot "Ratio Of Active Agents" foreach types [ set-current-plot-pen ? if any? agents with [agent-type = ?] [ plot count agents with [agent-type = ? and active?] / count agents with [agent-type = ?] ] ] end ; as facebook says, "it's complicated" to-report cooperation-levels report map [(word ? ": " ifelse-value any? agents with [agent-type = ?] [(count agents with [agent-type = ? and my-move = "C" ] / count agents with [agent-type = ?])] [0] )] types end to-report cooperation-rate report ifelse-value (any? agents) [(count agents with [my-move = "C" ] / count agents )] [0] end to-report scores report map [(word ? ": " ifelse-value any? agents with [agent-type = ?] [(sum [my-score] of agents with [agent-type = ? ] / count agents with [agent-type = ?])] [0] )] types end to-report active-ratio report map [(word ? ": " ifelse-value any? agents with [agent-type = ?] [(count agents with [agent-type = ? and active? ] / count agents with [agent-type = ?])] [0] )] types end to-report refusal-step report map [(word ? ": " ifelse-value any? agents with [agent-type = ?] [(count agents with [ refusing? ] / count agents with [agent-type = ?])] [0] )] types end to-report populations report map [(word ? ": " ifelse-value any? agents with [agent-type = ?] [(count agents with [agent-type = ? ] )] [0] )] types end to-report percent-bad-images report map [(word ? ": " ifelse-value any? agents with [agent-type = ?] [((sum [bad-images] of (agents with [agent-type = ?])) / count agents with [agent-type = ? ] )] [0] )] types end to-report gossipers-variance let result 0 if any? agents with [is-gossiper?] [ let mean-gossipers count agents with [is-gossiper?] / count agents show "passed" show [count my-agents] of groups if (any? groups with [not wacky? and count my-agents > 0]) [ set result sum [(count my-agents with [is-gossiper?] / count my-agents - mean-gossipers) ^ 2] of groups with [not wacky? and count my-agents > 0] ] ] report result end to print-group type "group " type who type ": [" print-agents-nocr my-agents print "]" end to print-agents-nocr [agentset] ask agentset [type "(" type who type "," type agent-type type ifelse-value active? ["+) "][") "] ] end to print-agents [agentset] print-agents-nocr agentset print "" end to-report num-of-refusals report sum [my-refusals] of agents end to-report num-of-defections-by-gossip report sum [my-defections-by-gossip] of agents end to-report bad-images if-else any? agents with [is-gossiper?] [ report count agents with [is-gossiper? and member? myself my-bad-images] / count agents with [is-gossiper?] ] [report 0] end to-report bad-images-of [an-agent] report count agents with [is-gossiper? and member? an-agent my-bad-images] / count agents with [is-gossiper?] end to-report find-max-id [a-list] let the-max max a-list ifelse (the-max > 1) [report position the-max a-list][report -1] end to-report is-punisher? report ifelse-value (agent-type = "NP" or agent-type = "MP") [true][ false] end to-report is-gossiper? report ifelse-value (agent-type = "NG" or agent-type = "MG") [true][ false] end to-report filename [ extra] report (word "./pics/Carpenter-v" version "-" substring remove ":" remove " " date-and-time 0 10 "-" extra "-" ticks ".world") ; time in ms to make the file different end @#$#@#$#@ GRAPHICS-WINDOW 204 10 449 229 -1 -1 7.833333333333333 1 10 1 1 1 0 1 1 1 0 23 0 23 0 0 1 ticks 30.0 SLIDER 12 10 184 43 ag-per-group ag-per-group 1 100 25 1 1 NIL HORIZONTAL BUTTON 11 163 133 196 NIL setup NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 11 201 133 234 go go\n T 1 T OBSERVER NIL NIL NIL NIL 1 SLIDER 12 47 185 80 benefit benefit 0 5 3 0.5 1 NIL HORIZONTAL PLOT 662 10 1161 160 populations by type NIL NIL 0.0 100.0 0.0 40.0 true true "" "" PENS "TFT" 1.0 0 -16777216 true "" "" "C" 1.0 0 -7500403 true "" "" "MP" 1.0 0 -2674135 true "" "" "NP" 1.0 0 -955883 true "" "" "FR" 1.0 0 -6459832 true "" "" "NG" 1.0 0 -1184463 true "" "" "MG" 1.0 0 -10899396 true "" "" PLOT 662 159 1161 309 % of bad images NIL NIL 0.0 1.0 0.0 1.0 true true "" "" PENS "TFT" 1.0 0 -16777216 true "" "" "C" 1.0 0 -7500403 true "" "" "MP" 1.0 0 -2674135 true "" "" "NP" 1.0 0 -955883 true "" "" "FR" 1.0 0 -6459832 true "" "" "NG" 1.0 0 -1184463 true "" "" "MG" 1.0 0 -10899396 true "" "" PLOT 665 471 1164 621 % of cooperations NIL NIL 0.0 100.0 0.0 1.1 true true "" "" PENS "TFT" 1.0 0 -16777216 true "" "" "C" 1.0 0 -7500403 true "" "" "MP" 1.0 0 -2674135 true "" "" "NP" 1.0 0 -955883 true "" "" "FR" 1.0 0 -6459832 true "" "" "NG" 1.0 0 -1184463 true "" "" "MG" 1.0 0 -10899396 true "" "" BUTTON 10 240 119 273 go-once go NIL 1 T OBSERVER NIL NIL NIL NIL 1 SLIDER 12 83 184 116 punishment punishment 0 10 5 1 1 NIL HORIZONTAL SLIDER 10 120 190 153 cost-of-punishing cost-of-punishing 0 10 1 0.1 1 NIL HORIZONTAL SLIDER 412 163 584 196 alpha alpha 0 1 0.2 .1 1 NIL HORIZONTAL PLOT 666 310 1161 467 scores by type NIL NIL 0.0 100.0 -15.0 25.0 true true "" "" PENS "TFT" 1.0 0 -16777216 true "" "" "C" 1.0 0 -7500403 true "" "" "MP" 1.0 0 -2674135 true "" "" "NP" 1.0 0 -955883 true "" "" "FR" 1.0 0 -6459832 true "" "" "NG" 1.0 0 -1184463 true "" "" "MG" 1.0 0 -10899396 true "" "" MONITOR 414 276 528 321 total bad images sum [count my-bad-images] of agents 17 1 11 SWITCH 408 11 498 44 gossip? gossip? 0 1 -1000 CHOOSER 409 50 566 95 gossiper-strategy gossiper-strategy "refuse" "defect" "assort" "leader" "compare-1" 0 SLIDER 412 200 584 233 beta beta 0 1 0.2 0.1 1 NIL HORIZONTAL PLOT 204 386 404 536 gossips NIL NIL 0.0 10.0 0.0 10.0 true false "" "" PENS "num-of-gossips" 1.0 0 -16777216 true "" "" PLOT 203 234 403 384 freq of gossipers NIL NIL 0.0 10.0 0.0 10.0 true false "" "" PENS "pen-0" 1.0 1 -16777216 true "" "" PLOT 430 383 630 533 group performance NIL NIL 0.0 20.0 0.0 10.0 true false "" "" PENS "default" 1.0 1 -16777216 true "" "" SLIDER 10 280 182 313 n-TFT n-TFT 0 100 0 5 1 NIL HORIZONTAL SLIDER 9 317 181 350 n-C n-C 0 100 100 5 1 NIL HORIZONTAL SLIDER 9 354 181 387 n-MP n-MP 0 100 100 5 1 NIL HORIZONTAL SLIDER 9 429 181 462 n-FR n-FR 0 300 100 5 1 NIL HORIZONTAL SLIDER 8 467 180 500 n-NG n-NG 0 100 0 5 1 NIL HORIZONTAL SLIDER 9 392 181 425 n-NP n-NP 0 100 0 1 1 NIL HORIZONTAL SLIDER 8 502 180 535 n-MG n-MG 0 100 100 5 1 NIL HORIZONTAL PLOT 665 623 1165 767 Ratio Of Active Agents NIL NIL 0.0 100.0 0.0 1.1 true true "" "" PENS "TFT" 1.0 0 -16777216 true "" "" "C" 1.0 0 -7500403 true "" "" "MP" 1.0 0 -2674135 true "" "" "NP" 1.0 0 -955883 true "" "" "FR" 1.0 0 -6459832 true "" "" "NG" 1.0 0 -1184463 true "" "" "MG" 1.0 0 -10899396 true "" "" SLIDER 14 576 186 609 num-of-gossips num-of-gossips 0 20 10 1 1 NIL HORIZONTAL SWITCH 410 98 519 131 evolve? evolve? 0 1 -1000 SLIDER 14 613 186 646 endowment endowment 0 100 50 5 1 NIL HORIZONTAL SWITCH 206 614 368 647 group-keep-size group-keep-size 0 1 -1000 PLOT 381 542 581 692 refusals or assortances NIL NIL 0.0 10.0 0.0 10.0 true false "" "" PENS "default" 1.0 1 -16777216 true "" "plot count agents with [refusing? or shifting?]" BUTTON 19 664 82 697 LpLc set n-TFT 50 set n-C 50 set n-MP 50 \nset n-NP 50 set n-NG 50 set n-MG 50 \nset punishment 1 set cost-of-punishing 0.2\nset endowment 50 set alpha 0.2 set beta 0.2 \nset evolve? false\nset gossip? true NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 83 665 148 698 HpHc set n-TFT 50 set n-C 50 set n-MP 50 \nset n-NP 50 set n-NG 50 set n-MG 50 \nset punishment 5 set cost-of-punishing 1\nset endowment 50 set alpha 0.2 set beta 0.2 \nset evolve? false\nset gossip? true NIL 1 T OBSERVER NIL NIL NIL NIL 1 PLOT 226 699 645 849 punishments NIL NIL 0.0 10.0 0.0 10.0 true false "" "" PENS "default" 1.0 0 -16777216 true "" "plot total-punishments" BUTTON 24 713 147 746 mabs set n-TFT 0 set n-C 50 set n-MP 50 \nset n-NP 0 set n-NG 0 set n-MG 50 set n-FR 50 \nset punishment 5 set cost-of-punishing 1\nset endowment 50 set alpha 0.2 set beta 0.2 \nset evolve? true\nset gossip? true\nset group-keep-size true NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 193 694 256 727 test set n-TFT 40 set n-C 40 set n-MP 40 \nset n-NP 40 set n-NG 40 set n-MG 40 set n-FR 40\nset punishment 5 set cost-of-punishing 1\nset endowment 50 set alpha 0.2 set beta 0.2 \nset evolve? false\nset gossip? true NIL 1 T OBSERVER NIL NIL NIL NIL 1 SWITCH 502 11 653 44 gossip-always? gossip-always? 0 1 -1000 CHOOSER 524 100 662 145 evolution-how evolution-how "tot-score" "last-score" 0 @#$#@#$#@ ## WHAT IS IT? ## HOW IT WORKS ## HOW TO USE IT ## THINGS TO NOTICE ## THINGS TO TRY ## NETLOGO FEATURES ## HOW TO CITE ## CREDITS AND REFERENCES Copyright 2012 Mario Paolucci & Jelly Biafra under the GPL licence. Developed at LABSS (http://labss.istc.cnr.it/) @#$#@#$#@ 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 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 sheep false 0 Rectangle -7500403 true true 151 225 180 285 Rectangle -7500403 true true 47 225 75 285 Rectangle -7500403 true true 15 75 210 225 Circle -7500403 true true 135 75 150 Circle -16777216 true false 165 76 116 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 5.0.5 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ setup go cooperation-levels scores populations cooperation-rate sum [my-refusals] of agents active-ratio refusal-step percent-bad-images total-punishments setup go cooperation-levels scores populations cooperation-rate sum [my-refusals] of agents active-ratio refusal-step percent-bad-images total-punishments gossipers-variance setup go cooperation-levels scores populations cooperation-rate sum [my-refusals] of agents active-ratio refusal-step percent-bad-images total-punishments setup go cooperation-levels scores populations cooperation-rate sum [my-refusals] of agents active-ratio refusal-step percent-bad-images total-punishments setup go cooperation-levels scores populations cooperation-rate sum [my-refusals] of agents active-ratio refusal-step percent-bad-images total-punishments setup go cooperation-levels scores populations cooperation-rate sum [my-refusals] of agents active-ratio refusal-step percent-bad-images total-punishments setup go cooperation-levels scores populations cooperation-rate sum [my-refusals] of agents active-ratio refusal-step percent-bad-images total-punishments setup go cooperation-levels scores populations cooperation-rate sum [my-refusals] of agents active-ratio refusal-step percent-bad-images total-punishments setup go cooperation-levels scores populations cooperation-rate sum [my-refusals] of agents active-ratio refusal-step percent-bad-images total-punishments setup go cooperation-levels scores populations cooperation-rate sum [my-refusals] of agents active-ratio refusal-step percent-bad-images total-punishments setup go cooperation-levels scores populations cooperation-rate sum [my-refusals] of agents active-ratio refusal-step percent-bad-images total-punishments @#$#@#$#@ @#$#@#$#@ 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 @#$#@#$#@ 0 @#$#@#$#@