-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.nlogo
2110 lines (1963 loc) · 54.4 KB
/
model.nlogo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
extensions[Nw array]
globals[L M]
breed[OCs OC] ;orange circles
breed[BCs BC] ;blue circles
breed[OSs OS] ;orange stars
breed[BSs BS] ;blue stars
undirected-link-breed[inLinks inLink] ;links with agents of the same color and shape
undirected-link-breed[outLinksColor outLinkColor] ;with the same shape, but of different color
undirected-link-breed[outLinksShape outLinkShape] ;with the same color, but of different shape
undirected-link-breed[outLinks outLink] ;with different color and shape
links-own[fairness] ;is this collaboration fair? If no, who discriminates?
turtles-own[
mSelf mOut mOutshape mOutColor ;productivity multipliers
strategyIn strategyOut strategyOutColor strategyOutShape ;current strategies of this agent
payoffsIn payoffsOut payoffsOutColor payoffsOutShape ;(potential) payoffs of each strategy in the last round
energy ;actual payoff from the last game
]
;runs once as the simulation starts
to setup
clear-all
set M 5
set L (10 - H)
setupAgents
if mode = "Fixed network" [setupNetwork]
reset-ticks
end
;runs once per tick/ round
to go
ifelse ticks >= maxTicks [stop][tick]
play
;mode decides what gets updated
(ifelse mode = "Fixed network" [
ask turtles [
let i random-float 1
if i < updateChance [updateStrategies]
]
] mode = "Fixed strategies"[
ask one-of turtles [updateNetwork]
][
ask turtles [
let i random-float 1
let j random-float 1
if i < updateChance AND j < 0.5 [updateStrategies]
if i < updateChance AND j > 0.5 [updateNetwork]
]
])
checkLinks
end
;each group of agents is initialized separately
to setupAgents
create-OCs sizeOC[
set color orange
set shape "circle"
set mSelf mOrange * mCircle
set mOut (mSelf + mBlue * mStar) / 2
set mOutColor (mSelf + mBlue * mCircle) / 2
set mOutShape (mSelf + mOrange * mStar) / 2
if mode = "Fixed strategies" [
set strategyIn 1
(ifelse
OC-BC = "OC > BC" [set strategyOutColor 2]
OC-BC = "OC < BC" [set strategyOutColor 0]
[set strategyOutColor 1]
)
(ifelse
OC-OS = "OC > OS" [set strategyOutShape 2]
OC-OS = "OC < OS" [set strategyOutShape 0]
[set strategyOutShape 1]
)
(ifelse
OC-BS = "OC > BS" [set strategyOut 2]
OC-BS = "OC < BS" [set strategyOut 0]
[set strategyOut 1]
)
]
]
create-OSs sizeOS[
set color orange
set shape "star"
set mSelf mOrange * mStar
set mOut (mSelf + mBlue * mCircle) / 2
set mOutColor (mSelf + mBlue * mStar) / 2
set mOutShape (mSelf + mOrange * mCircle) / 2
if mode = "Fixed strategies" [
set strategyIn 1
(ifelse
OS-BS = "OS > BS" [set strategyOutColor 2]
OS-BS = "OS < BS" [set strategyOutColor 0]
[set strategyOutColor 1]
)
(ifelse
OC-OS = "OC < OS" [set strategyOutShape 2]
OC-OS = "OC > OS" [set strategyOutShape 0]
[set strategyOutShape 1]
)
(ifelse
BC-OS = "BC < OS" [set strategyOut 2]
BC-OS = "BC > OS" [set strategyOut 0]
[set strategyOut 1]
)
]
]
create-BSs sizeBS[
set color blue
set shape "star"
set mSelf mBlue * mStar
set mOut (mSelf + mOrange * mCircle) / 2
set mOutColor (mSelf + mOrange * mStar) / 2
set mOutShape (mSelf + mBlue * mCircle) / 2
if mode = "Fixed strategies" [
set strategyIn 1
(ifelse
OS-BS = "OS < BS" [set strategyOutColor 2]
OS-BS = "OS > BS" [set strategyOutColor 0]
[set strategyOutColor 1]
)
(ifelse
BC-BS = "BC < BS" [set strategyOutShape 2]
BC-BS = "BC > BS" [set strategyOutShape 0]
[set strategyOutShape 1]
)
(ifelse
OC-BS = "OC < BS" [set strategyOut 2]
OC-BS = "OC > BS" [set strategyOut 0]
[set strategyOut 1]
)
]
]
create-BCs sizeBC[
set color blue
set shape "circle"
set mSelf mBlue * mCircle
set mOut (mSelf + mOrange * mStar) / 2
set mOutColor (mSelf + mOrange * mCircle) / 2
set mOutShape (mSelf + mBlue * mStar) / 2
if mode = "Fixed strategies" [
set strategyIn 1
(ifelse
OC-BC = "OC < BC" [set strategyOutColor 2]
OC-BC = "OC > BC" [set strategyOutColor 0]
[set strategyOutColor 1]
)
(ifelse
BC-BS = "BC > BS" [set strategyOutShape 2]
BC-BS = "BC < BS" [set strategyOutShape 0]
[set strategyOutShape 1]
)
(ifelse
BC-OS = "BC > OS" [set strategyOut 2]
BC-OS = "BC < OS" [set strategyOut 0]
[set strategyOut 1]
)
]
]
;all agents are placed in a random position of the world, initialized with empty payoff lists
;if strategies are to be updated, they also start with random demands for each group
ask turtles[
set xcor random-xcor
set ycor random-ycor
set payoffsIn array:from-list (list 0 0 0)
set payoffsOut array:from-list (list 0 0 0)
set payoffsOutColor array:from-list (list 0 0 0)
set payoffsOutShape array:from-list (list 0 0 0)
if mode != "Fixed strategies"[
set strategyIn random 3
set strategyOutColor random 3
set strategyOut random 3
set strategyOutShape random 3
]
]
end
;creates a network based on pIn and pOut for both shape and color
to setupNetwork
ask turtles[
ask other turtles[
let i random-float 1
if color = [color] of myself AND shape = [shape] of myself AND (i > (1 - pInColor) * (1 - pInShape))[
createLink myself self
]
if color = [color] of myself AND shape != [shape] of myself AND (i > (1 - pInColor) * (1 - pOutShape))[
createLink myself self
]
if color != [color] of myself AND shape = [shape] of myself AND (i > (1 - pOutColor) * (1 - pInShape))[
createLink myself self
]
if color != [color] of myself AND shape != [shape] of myself AND (i > (1 - pOutColor) * (1 - pOutShape))[
createLink myself self
]
]
]
;checks whether the just created network is connected
let pathCheck true
ask turtles[
ask other turtles[
if nw:path-to myself = false [set pathCheck false]
]
]
print (word "It is " pathCheck " that there are paths between any two agents.")
if (pathCheck = false AND requireConnectedGraph = true) [
print "Because the settings require a connected graph, the network will now be regenerated."
setupNetwork
]
checkLinks
end
;categorizes each individual link as fair or discriminatory
to checkLinks
ask inlinks [
let i 0
ask both-ends [set i i + strategyIn]
ifelse i = 2 * [strategyIn] of one-of both-ends [set fairness "fair"][set fairness "unfair"]
]
ask outLinksColor [
let i [strategyOutColor] of one-of both-ends with [color = orange]
let j [strategyOutColor] of one-of both-ends with [color = blue]
if i = j [set fairness "fair"]
if i > j [set fairness "Orange discriminates"] ;and i = 2
if i < j [set fairness "Blue discriminates"]
]
ask outLinksShape [
let i [strategyOutShape] of one-of both-ends with [shape = "circle"]
let j [strategyOutShape] of one-of both-ends with [shape = "star"]
if i = j [set fairness "fair"]
if i > j [set fairness "Circle discriminates"]
if i < j [set fairness "Star discriminates"]
]
ask outLinks[
ifelse any? both-ends with [shape = "circle" and color = orange][
let i [strategyOut] of one-of both-ends with [shape = "circle"]
let j [strategyOut] of one-of both-ends with [shape = "star"]
if i = j [set fairness "fair"]
if i > j [set fairness "Orange circle discriminates"]
if i < j [set fairness "Blue star discriminates"]
][
let i [strategyOut] of one-of both-ends with [shape = "circle"]
let j [strategyOut] of one-of both-ends with [shape = "star"]
if i = j [set fairness "fair"]
if i > j [set fairness "Blue circle discriminates"]
if i < j [set fairness "Orange star discriminates"]
]
]
end
;determines the (potential) payoff for each agent for each strategy
to play
ask turtles[
;determines the payoffs for each of the 12 combinations of links and strategies
array:set payoffsIn 0 ((count inLink-neighbors) * L * mSelf)
array:set payoffsIn 1 (count inLink-neighbors with [strategyIn < 2] * M * mSelf)
array:set payoffsIn 2 (count inLink-neighbors with [strategyIn < 1] * H * mSelf)
array:set payoffsOutColor 0 (count outLinkColor-neighbors * L * mOutColor)
array:set payoffsOutColor 1 (count outLinkColor-neighbors with [strategyOutColor < 2] * M * mOutColor)
array:set payoffsOutColor 2 ((count outLinkColor-neighbors with [strategyOutColor < 1]) * H * mOutColor)
array:set payoffsOutShape 0 (count outLinkShape-neighbors * L * mOutShape)
array:set payoffsOutShape 1 (count outLinkShape-neighbors with [strategyOutShape < 2] * M * mOutShape)
array:set payoffsOutShape 2 (count outLinkShape-neighbors with [strategyOutShape < 1] * H * mOutShape)
array:set payoffsOut 0 (count outLink-neighbors * L * mOut)
array:set payoffsOut 1 (count outLink-neighbors with [strategyOut < 2] * M * mOut)
array:set payoffsOut 2 (count outLink-neighbors with [strategyOut < 1] * H * mOut)
;determine the energy (or actual payoff) based on the strategies played
set energy (array:item payoffsIn strategyIn
+ array:item payoffsOut strategyOut
+ array:item payoffsOutShape strategyOutShape
+ array:item payoffsOutColor strategyOutColor)
]
end
;the agent updates their strategies to those that would have given biggest payoffs this round
to updateStrategies
if count inLink-neighbors > 0 [set strategyIn rndMaxIndex array:to-list payoffsIn]
if count outLinkShape-neighbors > 0 [set strategyOutShape rndMaxIndex array:to-list payoffsOutShape]
if count outLinkColor-neighbors > 0 [set strategyOutColor rndMaxIndex array:to-list payoffsOutColor]
if count outLink-neighbors > 0 [set strategyOut rndMaxIndex array:to-list payoffsOut]
end
;follows the (somewhat contrived) procedure for network updates as described by Rubin & O'Connor
to updateNetwork
let agent1 self
let agent2 one-of turtles with [who != [who] of agent1]
let agent3 one-of turtles with [who != [who] of agent2 and who != [who] of agent1]
let i count link-neighbors
while [[who] of agent1 = [who] of agent2][
set agent2 one-of other turtles
]
ask agent2[
let j count link-neighbors
let payoff1 determinePayoff agent1 agent2
let payoff2 determinePayoff agent2 agent1
let currentPayoff1 item 0 worstLink agent1
let currentPayoff2 item 0 worstLink agent2
let worthIt1 payoff1 > currentPayoff1
let worthIt2 payoff2 > currentPayoff2
ifelse link-neighbor? agent1 [
;This is what heppens if active and passive agents are already collaborating
ask agent1 [
ask agent3[
let k count link-neighbors
let payoff3 determinePayoff agent3 agent1
let currentPayoff3 item 0 worstLink agent3
set worthIt1 determinePayoff agent1 agent2 < determinePayoff agent1 agent3
let worthIt3 payoff3 > currentPayoff3
if i < maxLinks and k < maxLinks [createLink agent1 agent3]
if i = maxLinks and k < maxLinks and worthIt1 [
ask agent1 [ask link-with agent2 [die]]
createLink agent1 agent3
]
if i < maxLinks and k = maxLinks and worthIt3 [
ask item 1 worstLink agent3 [die]
createLink agent1 agent3
]
if i = maxLinks and k = maxLinks and worthIt1 and worthIt3 [
ask agent1 [ask link-with agent2 [die]]
ask item 1 worstLink agent3 [die]
createLink agent1 agent3
]
]
]
][
;This happens when the active and passive agents are not yet collaborators
if i < maxLinks and j < maxLinks [createLink agent1 agent2]
if i = maxLinks and j < maxLinks and worthIt1 [
ask item 1 worstLink agent1 [die]
createLink agent1 agent2
]
if i < maxLinks and j = maxLinks and worthIt2 [
ask item 1 worstLink agent2 [die]
createLink agent1 agent2
]
if i = maxLinks and j = maxLinks and worthIt1 and worthIt2 [
ask item 1 worstLink agent1 [die]
ask item 1 worstLink agent2 [die]
createLink agent1 agent2
]
]
]
end
;reports the payoff a link with agent2 has/ would have for agent1
to-report determinePayoff [agent1 agent2]
let strategy1 0
let strategy2 0
let result 0
(ifelse
[color] of agent1 = [color] of agent2 AND [shape] of agent1 = [shape] of agent2 [
set strategy1 [strategyIn] of agent1
set strategy2 [strategyIn] of agent2
]
[color] of agent1 = [color] of agent2 AND [shape] of agent1 != [shape] of agent2[
set strategy1 [strategyOutShape] of agent1
set strategy2 [strategyOutShape] of agent2
]
[color] of agent1 != [color] of agent2 AND [shape] of agent1 = [shape] of agent2[
set strategy1 [strategyOutColor] of agent1
set strategy2 [strategyOutColor] of agent2
][
set strategy1 [strategyOut] of agent1
set strategy2 [strategyOut] of agent2
]
)
if strategy1 = 0 [set result L]
if strategy1 = 1 and strategy2 < 2 [set result M]
if strategy1 = 2 and strategy2 < 1 [set result H]
report result * ([mSelf] of agent1 + [mSelf] of agent2) / 2
end
;reports the agent's link with the lowest payoff
to-report worstLink [agent]
let utility 100000 ;arbitrarily high value to be counted down
let myWorstLink one-of my-links
ask agent[
ask my-links [
if utility > determinePayoff myself other-end[
set utility determinePayoff myself other-end
set myWorstLink self
]
]
]
report (list utility myWorstLink)
end
;creates the right kind of link between two agents, in terms of breed, color and shape
to createLink [agent1 agent2]
ask agent1 [
ask agent2 [
(ifelse
[color] of agent1 = [color] of agent2 AND [shape] of agent1 = [shape] of agent2 [
create-inLink-with myself
ask link-with myself [
set color [color] of myself
set shape [shape] of myself
]
]
[color] of agent1 = [color] of agent2 AND [shape] of agent1 != [shape] of agent2[
create-outLinkShape-with myself
ask link-with myself [
set color [color] of myself
set shape "default"
]
]
[color] of agent1 != [color] of agent2 AND [shape] of agent1 = [shape] of agent2[
create-outLinkColor-with myself
ask link-with myself [
set color white
set shape [shape] of myself
]
][
create-outLink-with myself
ask link-with myself [
set color white
set shape "default"
]
]
)
]
]
end
;reports a random index of the maximum value in a list (unlike the max function)
to-report rndMaxIndex [input]
let maxValue max input
let indices n-values length input [ ? -> ifelse-value (item ? input = maxValue) [?][false]]
let results filter [i -> i != false] indices
report one-of results
end
@#$#@#$#@
GRAPHICS-WINDOW
12
10
522
521
-1
-1
15.212121212121213
1
10
1
1
1
0
0
0
1
-16
16
-16
16
0
0
1
ticks
30.0
BUTTON
204
534
277
567
NIL
setup\n
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
288
534
351
567
NIL
go
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
SLIDER
525
808
697
841
sizeOC
sizeOC
1
100
10.0
1
1
NIL
HORIZONTAL
SLIDER
700
842
872
875
sizeBS
sizeBS
0
100
40.0
1
1
NIL
HORIZONTAL
SLIDER
525
673
697
706
pInColor
pInColor
0
1
0.01
0.01
1
NIL
HORIZONTAL
SLIDER
526
711
698
744
pOutColor
pOutColor
0
1
0.01
0.01
1
NIL
HORIZONTAL
SWITCH
37
595
238
628
requireConnectedGraph
requireConnectedGraph
0
1
-1000
SLIDER
241
595
414
628
H
H
0
10
6.0
1
1
NIL
HORIZONTAL
SLIDER
212
633
385
666
updateChance
updateChance
0
1
0.1
0.05
1
NIL
HORIZONTAL
BUTTON
355
534
419
568
NIL
go
T
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
PLOT
527
10
968
434
Link fainess
ticks
Percentage of all links
0.0
10.0
0.0
100.0
true
true
"" ""
PENS
"Fair inlinks" 1.0 0 -7500403 true "" "if count inlinks with [fairness = \"fair\"] > 0 [plot (count inlinks with [fairness = \"fair\"]) / count links * 100]"
"Fair outlinks" 1.0 0 -10899396 true "" "if count links with [breed != inlinks AND fairness = \"fair\"] > 0 [plot (count links with [breed != inlinks AND fairness = \"fair\"]) / count links * 100]"
"Unfair outlinks" 1.0 0 -2674135 true "" "if count Links > 0 [plot (count Links with [fairness != \"fair\" AND breed != inlinks]) / count links * 100]"
"Unfair inlinks" 1.0 0 -8630108 true "" "if count inlinks with [fairness = \"unfair\"] > 0 [plot (count inlinks with [fairness = \"unfair\"]) / count links * 100]"
CHOOSER
29
527
195
572
Mode
Mode
"Fixed network" "Fixed strategies" "Dynamic"
0
SLIDER
36
633
209
666
maxLinks
maxLinks
1
50
3.0
1
1
NIL
HORIZONTAL
PLOT
971
10
1472
435
Linkcounts
Ticks
Links
0.0
10.0
0.0
10.0
true
true
"" ""
PENS
"Between Colors" 1.0 0 -7500403 true "" "plot count links with [color = white]"
"Within Orange" 1.0 0 -955883 true "" "plot count links with [color = orange]"
"Within Blue" 1.0 0 -13345367 true "" "plot count Links with [color = blue]"
"Within Circles" 1.0 0 -5825686 true "" "plot count Links with [shape = \"circle\"]"
"Within Stars" 1.0 0 -2674135 true "" "plot count Links with [shape = \"star\"]"
"Between Shapes" 1.0 0 -6459832 true "" "plot count Links with [shape = \"default\"]"
"Proper outlinks" 1.0 0 -13840069 true "" "plot count outlinks"
INPUTBOX
36
676
197
736
maxTicks
100.0
1
0
Number
SLIDER
701
673
873
706
pInShape
pInShape
0
1
0.01
0.01
1
NIL
HORIZONTAL
SLIDER
699
807
871
840
sizeOS
sizeOS
0
100
10.0
1
1
NIL
HORIZONTAL
SLIDER
525
842
697
875
sizeBC
sizeBC
0
100
40.0
1
1
NIL
HORIZONTAL
SLIDER
701
711
874
744
pOutShape
pOutShape
0.00
1
0.01
0.01
1
NIL
HORIZONTAL
TEXTBOX
191
756
341
774
Strategy fairness
12
0.0
0
CHOOSER
35
781
173
826
OC-OS
OC-OS
"OC > OS" "OC < OS" "OC = OS"
0
CHOOSER
176
781
314
826
OC-BC
OC-BC
"OC > BC" "OC < BC" "OC = BC"
2
CHOOSER
316
781
454
826
OC-BS
OC-BS
"OC > BS" "OC < BS" "OC = BS"
0
CHOOSER
35
828
173
873
BC-OS
BC-OS
"BC > OS" "BC < OS" "BC = OS"
0
CHOOSER
176
828
314
873
BC-BS
BC-BS
"BC > BS" "BC < BS" "BC = BS"
0
CHOOSER
316
828
454
873
OS-BS
OS-BS
"OS > BS" "OS < BS" "OS = BS"
0
PLOT
1475
10
1917
435
Energy
ticks
Mean energy per group
0.0
10.0
0.0
10.0
true
true
"" ""
PENS
"Orange circles" 1.0 0 -955883 true "" "let i 0\nask OCs[ set i i + energy]\nplot i / count OCs"
"Orange stars" 1.0 0 -10899396 true "" "let i 0\nask OSs[ set i i + energy]\nplot i / count OSs"
"Blue circles" 1.0 0 -13345367 true "" "let i 0\nask BCs[ set i i + energy]\nplot i / count BCs"
"Blue stars" 1.0 0 -2064490 true "" "let i 0\nask BSs[ set i i + energy]\nplot i / count BSs"
PLOT
968
438
1286
712
OC-OS
ticks
Percentage of links
0.0
10.0
0.0
100.0
true
true
"" ""
PENS
"OC > OS" 1.0 0 -2674135 true "" "let i 0\nlet j 0\nask OCs [ \nask my-outLinksShape[\n set i i + 1\n if fairness = \"Circle discriminates\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
"OC < OS" 1.0 0 -10899396 true "" "let i 0\nlet j 0\nask OCs [\nask my-outLinksShape[\n set i i + 1\n if fairness = \"Star discriminates\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
"OC = OS" 1.0 0 -7500403 true "" "let i 0\nlet j 0\nask OCs[ask my-outlinksShape[\nset i i + 1\n if fairness = \"fair\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
PLOT
1288
438
1607
712
OC-BC
ticks
Percentage of links
0.0
10.0
0.0
100.0
true
true
"" ""
PENS
"OC > BC" 1.0 0 -2674135 true "" "let i 0\nlet j 0\nask OCs [ \nask my-outLinksColor[\n set i i + 1\n if fairness = \"Orange discriminates\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
"OC < BC" 1.0 0 -10899396 true "" "let i 0\nlet j 0\nask OCs [ \nask my-outLinksColor[\n set i i + 1\n if fairness = \"Blue discriminates\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
"OC = BC" 1.0 0 -7500403 true "" "let i 0\nlet j 0\nask OCs [ \nask my-outLinksColor[\n set i i + 1\n if fairness = \"fair\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
PLOT
1610
438
1918
712
OC-BS
ticks
Percentage of links
0.0
10.0
0.0
100.0
true
true
"" ""
PENS
"OC > BS" 1.0 0 -2674135 true "" "let i 0\nlet j 0\nask OCs [ \nask my-outLinks[\n set i i + 1\n if fairness = \"Orange circle discriminates\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
"OC < BS" 1.0 0 -10899396 true "" "let i 0\nlet j 0\nask OCs [ \nask my-outLinks[\n set i i + 1\n if fairness = \"Blue star discriminates\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
"OC = BS" 1.0 0 -7500403 true "" "let i 0\nlet j 0\nask OCs [ \nask my-outLinks[\n set i i + 1\n if fairness = \"fair\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
PLOT
968
714
1286
989
BC-OS
ticks
Percentage of links
0.0
10.0
0.0
100.0
true
true
"" ""
PENS
"BC > OS" 1.0 0 -2674135 true "" "let i 0\nlet j 0\nask BCs [ \nask my-outLinks[\n set i i + 1\n if fairness = \"Blue circle discriminates\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
"BC < OS" 1.0 0 -10899396 true "" "let i 0\nlet j 0\nask BCs [ \nask my-outLinks[\n set i i + 1\n if fairness = \"Orange star discriminates\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
"BC = OS" 1.0 0 -7500403 true "" "let i 0\nlet j 0\nask BCs [ \nask my-outLinks[\n set i i + 1\n if fairness = \"fair\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
PLOT
1288
714
1608
990
BC-BS
ticks
Percentage of links
0.0
10.0
0.0
100.0
true
true
"" ""
PENS
"BC > BS" 1.0 0 -2674135 true "" "let i 0\nlet j 0\nask BCs [ \nask my-outLinksShape[\n set i i + 1\n if fairness = \"Circle discriminates\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
"BC < BS" 1.0 0 -10899396 true "" "let i 0\nlet j 0\nask BCs [ \nask my-outLinksShape[\n set i i + 1\n if fairness = \"Star discriminates\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
"BC = BS" 1.0 0 -7500403 true "" "let i 0\nlet j 0\nask BCs [ \nask my-outLinksShape[\n set i i + 1\n if fairness = \"fair\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
PLOT
1610
714
1919
990
OS-BS
ticks
Percentage of links
0.0
10.0
0.0
100.0
true
true
"" ""
PENS
"OS > BS" 1.0 0 -2674135 true "" "let i 0\nlet j 0\nask OSs [ \nask my-outLinksColor[\n set i i + 1\n if fairness = \"Orange discriminates\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
"OS < BS" 1.0 0 -10899396 true "" "let i 0\nlet j 0\nask OSs [ \nask my-outLinksColor[\n set i i + 1\n if fairness = \"Blue discriminates\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
"OS = BS" 1.0 0 -7500403 true "" "let i 0\nlet j 0\nask OSs [ \nask my-outLinksColor[\n set i i + 1\n if fairness = \"fair\" [set j j + 1]\n ]\n]\nif i > 0 [plot j / i * 100]\n"
SLIDER
528
534
703