-
Notifications
You must be signed in to change notification settings - Fork 5
/
examples.nb
2440 lines (2322 loc) · 104 KB
/
examples.nb
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
(* Content-type: application/mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 7.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 145, 7]
NotebookDataLength[ 105895, 2432]
NotebookOptionsPosition[ 98738, 2288]
NotebookOutlinePosition[ 99075, 2303]
CellTagsIndexPosition[ 99032, 2300]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell["Evolutionary Spatial Game Theory examples", "Title",
CellChangeTimes->{{3.496464274781529*^9,
3.496464284764421*^9}},ExpressionUUID->"c92332f7-8ef8-45d2-acf1-\
714beafa41a3"],
Cell["\<\
Make sure this file is in the same directory as SGT.m, and then execute the \
following cell:\
\>", "Subsubtitle",
CellChangeTimes->{{3.49646176374009*^9,
3.496461783205941*^9}},ExpressionUUID->"9b86630d-f56d-4744-b294-\
dedf65fdb4f9"],
Cell[BoxData[{
RowBox[{
RowBox[{"SetDirectory", "[",
RowBox[{"NotebookDirectory", "[", "]"}], "]"}],
";"}], "\[IndentingNewLine]",
RowBox[{"<<", "SGT`"}]}], "Input",
CellChangeTimes->{{3.496303159636127*^9, 3.496303190554049*^9}},
CellLabel->"In[81]:=",ExpressionUUID->"0b4d4ece-8289-4b4e-8813-544e4c30906f"],
Cell[CellGroupData[{
Cell["\<\
In any of the following examples, replace \"Visualize\" with \"Animation\" to \
see a movie of the result.\
\>", "Subsubtitle",
CellChangeTimes->{{3.496461683618668*^9, 3.496461698412085*^9}, {
3.496464297214489*^9,
3.496464297563962*^9}},ExpressionUUID->"25698deb-fea1-4a64-bc40-\
388b995689cf"],
Cell[CellGroupData[{
Cell["Rock paper scissors", "Section",
CellChangeTimes->{{3.496464354397766*^9,
3.496464357563818*^9}},ExpressionUUID->"6ae26e3e-0e19-4b1b-8370-\
fb8b820bbd2b"],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"rps", "=",
RowBox[{"Simulate", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"InitialPopulation", "\[Rule]",
RowBox[{"Randomized", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"-", "1"}], ",", "0", ",", "1"}], "}"}], ",",
RowBox[{"\"\<Smoothing\>\"", "\[Rule]", "1"}]}], "]"}]}], ",",
"\[IndentingNewLine]",
RowBox[{"Payoff", "\[Rule]", "RockPaperScissors"}], ",",
RowBox[{"AgentType", "\[Rule]", "\"\<Constant\>\""}], ",",
"\[IndentingNewLine]",
RowBox[{"Steps", "\[Rule]",
RowBox[{"1", ";;", "100"}]}]}], "]"}]}]], "Input",
InitializationCell->True,
CellChangeTimes->{{3.496303217864616*^9, 3.4963035447481947`*^9}, {
3.496304749220518*^9, 3.496304752779894*^9}, {3.496464362550651*^9,
3.496464382990432*^9}},
CellLabel->"In[3]:=",ExpressionUUID->"fa62afd1-4018-45f7-aa32-d1a58f0fb4be"],
Cell[BoxData[
RowBox[{
TagBox["SimulationData",
HoldForm], "[", "\<\"<100/100>\"\>", "]"}]], "Output",
CellChangeTimes->{3.496464390506925*^9, 3.772448206509797*^9},
CellLabel->"Out[3]=",ExpressionUUID->"033c4e3a-a3bc-465d-a2c3-b582c2fb4052"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Visualize", "[",
RowBox[{"rps", ",",
RowBox[{"Panels", "\[Rule]", "3"}], ",",
RowBox[{"Show", "\[Rule]", "\"\<Agents\>\""}], ",",
RowBox[{"ColorFunction", "\[Rule]", " ", "PastelHue"}], ",",
RowBox[{"Alignment", "\[Rule]", "Vertical"}]}], "]"}]], "Input",
InitializationCell->True,
CellChangeTimes->{{3.4963033286643744`*^9, 3.4963035592431717`*^9}, {
3.496464364814288*^9, 3.496464365902101*^9}},
CellLabel->"In[4]:=",ExpressionUUID->"08e08d15-358b-4bc7-acf9-a94e87161198"],
Cell[BoxData[
TagBox[GridBox[{
{
TemplateBox[{GraphicsBox[
RasterBox[CompressedData["
1:eJztmjFKBEEQRRcEj2C44A28wQZeQE3MhQUDwdRUUM+gN/EKnsDUUDDxCLKi
BsKy09v1679qHVjYKZqemuo31b+re//s8mS5M5vN5l+/1f+Lg5vdw/OXxf3D
6npazD6v95/7o8f57dvx62T79/3d6d7V8vp5san/3+032Vv96fU/y5/W5/b6
s25cth0v1bi0+tnKc+v70uLzz3MsD+o4qPNhdP8unil+uvIPjWf1fBHdv4sf
tT9T7dFcRcWnNV/R8gndnjXu2f5n5c9ef2jzDlWvRvHQ296dN6LyZDa31fJM
Np8uuztu2eumKM5p4+iaB6vYaXmD9l6u+FfhdhTdFdWPer3Wy3O03pvaT/S8
o3putfVONrdZ/qu5yu5fHYfROaliV3FFXadEPVfFJ63+v60eUMdzaj+jrF/o
+2VqXV2FWxpvVL2h3jevvn/0z7OHT/c6q5WHqPZ0Hmj+jFqPcvNM0ZmjxN9V
r6bXyavkk2id09qPKj607zRKN47Kszs/R9kp51FpuqL6+P5Vnulxds+btH18
VX0+Wp9H2Sn7bi4eRrWrdSa1vYr/6vWE6n66eejlJ3oeoe37TPXfzQllfqHl
Mbfu6rW76hhUPVblXEH2ucdq+rzXTvtOq/CcNe/08kbVURTO3fowm393nUTF
s6t9FZ5d3ztNh7vfd2p72vqdyjllP0jtD/V8QjbPWTpQxYmb5+z1nTo/q/OV
u86Tzfko9ViKTnbXx2h1Hlfepu0rUeKzbhw/AIEacJ0=
"], {{0, 0},
Offset[{150, 150}, {0, 0}]}, {0, 1}], ImageSize -> {150, 150},
PlotRange -> {{0, 150}, {0, 150}}, PlotRangeClipping -> True, Frame ->
False, FrameLabel -> {None, None},
FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle ->
Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2},
"HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}},
"DefaultPlotStyle" -> Automatic}],"\"t = 1\""},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )],
TemplateBox[{GraphicsBox[
RasterBox[CompressedData["
1:eJztm0FKA0EQRQcEj+AykBt4g1l4Ac3GvRBwIWSbraCeQW+SK3iCbF0KbnIE
iWQ2gcFkurrqVVUPBDI/Ybr615vu6nRm/rBaLC+6rpsdXvv37x/747O/3cxe
f+6+++7v2PVP1y+XN49f/fD5oEt9X1ofzt/ur9bL5y3u+lP9GWv31HioeSnt
VxTdyodT2x3j51xdKk4tnqW4jcq5VX9r+T+VZ+08To0nG89W/dL2+VwepPix
atc6vxRderyi61H7ZT1veueWMg7T8hv9fqHwqbU+ovlfqmebv7yMt9I803wu
5TC6b9rcZvVf+/deqg90Pr2MJ9L1v3a+rH2Lymet/Er7Sal7afNRVm5pfNK5
9cK5tQ90bqmce+Uwqm+NW6aelU/avgM9v1Hy3nQf3ErznH0/2pvudR1nVTc2
nhl6Fm4b57p1phcOKTzTOPTGrRVv2XmuXcdm5ZnCg9TzINbPSVF8qB2P9b4M
RddaX1M4ofFpVUc1zmV1L/2lxanFoVeeres6rz5Yx1+bZ4qftPWIVR0e5b6T
4pbOsxedxmc2nmv3ywtvXuKPwi1Fp+XF6n704g+NH5ruZdyj+TbVz+Fc+n8+
UfWo9SHNz8YzU2/7aGX6MZ//6TQ/S+Mc038BOUHXMQ==
"], {{0, 0},
Offset[{150, 150}, {0, 0}]}, {0, 1}], ImageSize -> {150, 150},
PlotRange -> {{0, 150}, {0, 150}}, PlotRangeClipping -> True, Frame ->
False, FrameLabel -> {None, None},
FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle ->
Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2},
"HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}},
"DefaultPlotStyle" -> Automatic}],"\"t = 50\""},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )],
TemplateBox[{GraphicsBox[
RasterBox[CompressedData["
1:eJzt2EFKA0EQBdCBgEdwGfAG3mAWXsC4cS8EXAjZuhVMzqA38QqewK1LwU2O
IJFkOTA9U9X//84PCOYTOjPVj+rKXD1s7taLruuWx7/D/0/Xrxc3j9/92/vh
9dl3/699f2756f3tx3L7u/oZ/fnT+9395fP65YsuZ6uzc7vN8Jztf6jOUTmb
K5WczSfKc5Q3+2zL7ZAHFv9Tr999mCtHe2BzW9s5m4dsV2qe1d26D3N5VtlH
tNva9VF3ld0Pp66PcqviWd1t1vWg9gX1HAntuXT9c5kfSq9TpW+w5uw+2TxH
fa/6OYjO2e+L7bkx+ryzW+1cZU6IPtfsts2czS3r7zjV87fVnK0Po+fbqH7O
sr/qOZvDVpzbs90y5vY8rj7szwfU81JXaOfsbp1j3Wavw+bZ/dA50xzivurc
btvvw6jzt9Z9ZXtgcYvqz2z7rp6j9l3FLcozyrnKuRO9v6UOS32yeGbbR7Zz
Vv2+oj3Xdouu/9g6RPVP9brV8s/uFj0XzXXLNh+y5VF9gC1H/U7P7rdsOZtn
13Oa82i3Q+tEzXvZn59bh1rzm6pPdB+Yu4/ouS5q/dqe2fo5232p1C3boT1P
c/sHGA1Zxw==
"], {{0, 0},
Offset[{150, 150}, {0, 0}]}, {0, 1}], ImageSize -> {150, 150},
PlotRange -> {{0, 150}, {0, 150}}, PlotRangeClipping -> True, Frame ->
False, FrameLabel -> {None, None},
FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle ->
Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2},
"HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}},
"DefaultPlotStyle" -> Automatic}],"\"t = 100\""},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )]}
},
AutoDelete->False,
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}],
"Grid"]], "Output",
CellChangeTimes->{3.496464391005376*^9, 3.7724482078326073`*^9},
CellLabel->"Out[4]=",ExpressionUUID->"1c676c75-73c9-49d5-ade9-c315d019bd6d"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Animation", "[",
RowBox[{"rps", ",",
RowBox[{"Panels", "\[Rule]", "3"}], ",",
RowBox[{"Show", "\[Rule]", "\"\<Agents\>\""}], ",", "\[IndentingNewLine]",
RowBox[{"ColorFunction", "\[Rule]", " ", "PastelHue"}], ",",
RowBox[{"Alignment", "\[Rule]", "Vertical"}]}], "]"}]], "Input",
InitializationCell->True,
CellChangeTimes->{{3.4963033286643744`*^9, 3.4963035592431717`*^9}, {
3.496464364814288*^9, 3.496464408223804*^9}, {3.772448226519845*^9,
3.772448255771645*^9}},
CellLabel->"In[83]:=",ExpressionUUID->"03d27b8a-0edc-4478-8211-963fd70ee43f"],
Cell[BoxData[
TagBox[
StyleBox[
DynamicModuleBox[{EGT`i$$ = 18, Typeset`show$$ = True,
Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu",
Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ =
"\"untitled\"", Typeset`specs$$ = {{
Hold[EGT`i$$], 1, 100, 1}}, Typeset`size$$ = {150., {90., 77.}},
Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True,
EGT`i$125763$$ = 0},
DynamicBox[Manipulate`ManipulateBoxes[
1, StandardForm, "Variables" :> {EGT`i$$ = 1},
"ControllerVariables" :> {
Hold[EGT`i$$, EGT`i$125763$$, 0]},
"OtherVariables" :> {
Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$,
Typeset`animator$$, Typeset`animvar$$, Typeset`name$$,
Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
Typeset`skipInitDone$$}, "Body" :> Check[
EGT`func$125761[EGT`i$$], "Error"],
"Specifications" :> {{
EGT`i$$, 1, 100, 1, AnimationRunning -> True, AnimationRepetitions ->
3, AnimationRate -> 10,
AppearanceElements -> {
"ProgressSlider", "PlayPauseButton", "FasterSlowerButtons",
"DirectionButton"}}},
"Options" :> {
ControlType -> Animator, AppearanceElements -> None, DefaultBaseStyle ->
"Animate", DefaultLabelStyle -> "AnimateLabel", SynchronousUpdating ->
True, ShrinkingDelay -> 10.}, "DefaultOptions" :> {}],
ImageSizeCache->{323., {118., 124.}},
SingleEvaluation->True],
Deinitialization:>None,
DynamicModuleValues:>{},
SynchronousInitialization->True,
UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
UnsavedVariables:>{Typeset`initDone$$},
UntrackedVariables:>{Typeset`size$$}], "Animate",
Deployed->True,
StripOnInput->False],
Manipulate`InterpretManipulate[1]]], "Output",
CellChangeTimes->{{3.496464392161478*^9, 3.496464590321349*^9},
3.772448210132491*^9, 3.772449953813043*^9},
CellLabel->"Out[83]=",ExpressionUUID->"a88ec330-cab7-4f1a-af16-807dbe351ef6"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"ExportAnimation", "[",
RowBox[{"\"\<rps.gif\>\"", ",", "rps", ",",
RowBox[{"Panels", "\[Rule]", "3"}], ",",
RowBox[{"Show", "\[Rule]", "\"\<Agents\>\""}], ",", "\[IndentingNewLine]",
RowBox[{"ColorFunction", "\[Rule]", " ", "PastelHue"}], ",",
RowBox[{"Alignment", "\[Rule]", "Vertical"}]}], "]"}]], "Input",
CellChangeTimes->{{3.77244825691041*^9, 3.772448271227165*^9}},
CellLabel->"In[84]:=",ExpressionUUID->"c1366977-5a7a-444b-a782-c653bf6e2ef6"],
Cell[BoxData["\<\"rps.gif\"\>"], "Output",
CellChangeTimes->{3.7724482728333673`*^9, 3.772448552570512*^9,
3.7724499659739637`*^9},
CellLabel->"Out[84]=",ExpressionUUID->"5dcc9b8d-e4e4-4690-a0fd-fd80422f248a"]
}, Open ]],
Cell[CellGroupData[{
Cell["Smoothed initial conditions", "Subsubsection",
CellChangeTimes->{{3.772451901379182*^9,
3.77245190472542*^9}},ExpressionUUID->"6a0fb66a-adb7-49d8-b636-\
16a080070334"],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"rps2", "=",
RowBox[{"Simulate", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"InitialPopulation", "\[Rule]",
RowBox[{"Randomized", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"-", "1"}], ",", "0", ",", "1"}], "}"}], ",",
RowBox[{"\"\<Smoothing\>\"", "\[Rule]", "4"}]}], "]"}]}], ",",
"\[IndentingNewLine]",
RowBox[{"Payoff", "\[Rule]", "RockPaperScissors"}], ",",
RowBox[{"AgentType", "\[Rule]", "\"\<Constant\>\""}], ",",
RowBox[{"Temperature", "\[Rule]", "0.02"}], ",", "\[IndentingNewLine]",
RowBox[{"Steps", "\[Rule]",
RowBox[{"1", ";;", "50"}]}]}], "]"}]}]], "Input",
CellChangeTimes->{{3.772449276140031*^9, 3.772449322822401*^9}, {
3.772449354571814*^9, 3.772449355051486*^9}, {3.772449464710299*^9,
3.772449470726986*^9}},
CellLabel->"In[72]:=",ExpressionUUID->"5d0a0485-3fcc-45bc-b37b-cdb01499b406"],
Cell[BoxData[
RowBox[{
TagBox["SimulationData",
HoldForm], "[", "\<\"<50/50>\"\>", "]"}]], "Output",
CellChangeTimes->{{3.7724492865712223`*^9, 3.7724493233497458`*^9},
3.772449355654108*^9, 3.772449471346444*^9},
CellLabel->"Out[72]=",ExpressionUUID->"e4728590-df1e-4b64-982c-22f6ed1bebc1"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Visualize", "[",
RowBox[{"rps2", ",",
RowBox[{"Panels", "\[Rule]", "3"}], ",",
RowBox[{"Show", "\[Rule]", "\"\<Agents\>\""}], ",",
RowBox[{"ColorFunction", "\[Rule]", " ", "PastelHue"}], ",",
RowBox[{"Alignment", "\[Rule]", "Vertical"}]}], "]"}]], "Input",
CellChangeTimes->{{3.772451441211938*^9, 3.7724514418663273`*^9}},
CellLabel->"In[94]:=",ExpressionUUID->"f6f4e9ee-2111-4141-8126-dfe0894e03f6"],
Cell[BoxData[
TagBox[GridBox[{
{
TemplateBox[{GraphicsBox[
RasterBox[CompressedData["
1:eJztm7EJwlAURT8IjmAZcAM3SOECamMvBCwEW1tBnUE3cQUnsLUUbBxBInbB
Jv5vznv/BoR4CkneOSEmJMPFelb1QgjF51Ovr0a7/nh5K4+nermU4b08G98P
88Gm2l5b88m52D+m98bv/5t/219x3zx2z5TOaXMWV8/qXJzaM6Vz2vzFbXar
nuN6zH1uXXerzll9epkbrVtKz7F80bbfyty8dEvvWfw3TutKPYurZ/WcG6f1
Q+M0X+LMTqxwmsdYfmnbr259dE7bL82h2zl4nY91npsXnb98c+teaP+7rMzN
Oqf59cpp3q1zml+vnObdCqd5zI3TeqBxmi9xZic0TvMlzuwkFdfznD649+fu
UnWrzpndeu2Z9n6El84pfnPjtG6tHRcUj7lxWlfWOc1vbpzWg1dO8+6V07yL
t+O0rv7FU13/itviXXeYqlt1Lk7qnH7fUtwHfwFGEK7H
"], {{0, 0},
Offset[{150, 150}, {0, 0}]}, {0, 1}], ImageSize -> {150, 150},
PlotRange -> {{0, 150}, {0, 150}}, PlotRangeClipping -> True, Frame ->
False, FrameLabel -> {None, None},
FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle ->
Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2},
"HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}},
"DefaultPlotStyle" -> Automatic}],"\"t = 1\""},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )],
TemplateBox[{GraphicsBox[
RasterBox[CompressedData["
1:eJzt2jEKwkAQBdCA4BEsA97AG6TwAmpjLwQsBFtbQT2D3sQreAJbS8HGI0jE
ShE07O78P/sDAf1FmJ15kGW1P1tO6k5RFOXrbj4vBpvucH6p9ofmOlXF87pX
Vvn79920t6rX59b56Fhub+Prx/N/zdH6Y9VntPrRcrnF7DNa/Wg5mtvYnkOv
N1aO5oQll2cfbmP3H22O8uwjR/OJNkd5xszRHLLMUZ59uQ01x1jzlWflFm7R
PaOtSzm2WxTPaPUrT+M2tAe55Zg7e462b5dbuc3BLdr7Qm59eLY+t5Fb7rl7
XZfc+nabm2fv+97c3bL8P8Q6l1vu3NqP3HK4jd0Heeb0L7eYbnM7/5HbuH2Q
WwzPcpvXvLT/9+UWzTOrW3bPXtxaefbmlsWzd7doeeo5fquH3TOb21B9yMXz
v/WweM7VbW6evZ5DsniO7ZbFc+qcxa08y7Mnt2ie2z5HnuWW6TzH+ne01E7Q
cnY/D7EdkV8=
"], {{0, 0},
Offset[{150, 150}, {0, 0}]}, {0, 1}], ImageSize -> {150, 150},
PlotRange -> {{0, 150}, {0, 150}}, PlotRangeClipping -> True, Frame ->
False, FrameLabel -> {None, None},
FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle ->
Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2},
"HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}},
"DefaultPlotStyle" -> Automatic}],"\"t = 25\""},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )],
TemplateBox[{GraphicsBox[
RasterBox[CompressedData["
1:eJzt2jFqAkEUxvGFQI6QUvAGucEWXiBJYy8IFoKtbSDJGfQmuYInsLUMpMkR
wopYaLXLvnn/ee9bEOSzcOa9344zrNPF5m350DTN5PLq3u/23XVom/P1137N
n7bL92NLzV++J5+/rz/Xz/vm6+ePx9nqdPc9fXPvOtDqTBs/LZdbZp1p46+l
bnIrt0PyUv2N6tbqPi2VW/mh5bS+U+eVJaf59O67PNeR0xxS+y7PrHxo3Urv
i6h9r3VetHWm1DpG2efL87B50VzJcwy31p6z5WP3xcqD9zqcxS1tvSqV9/Vw
m1PPd3IbO5dbuY2UUzzT9r3R3Y5VZ0q/vMdPqYPcMnLNV25r7GM2z3Jr26+o
+8Ooudyyz+nyzPKc1W3p5xHK5ZY0L6s+0rzRPMsts19e9afto7z7Ls853Zb2
HNUtzXNWt1aeo7r1+v3yvo+s6hzdczS3UTxbn/dr95zFrTzLs4fn0vWpxbOe
BzE90+pG+z+A3Pp69s7lOafb2j3Lrdx2+T86EbTz
"], {{0, 0},
Offset[{150, 150}, {0, 0}]}, {0, 1}], ImageSize -> {150, 150},
PlotRange -> {{0, 150}, {0, 150}}, PlotRangeClipping -> True, Frame ->
False, FrameLabel -> {None, None},
FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle ->
Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2},
"HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}},
"DefaultPlotStyle" -> Automatic}],"\"t = 50\""},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )]}
},
AutoDelete->False,
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}],
"Grid"]], "Output",
CellChangeTimes->{3.772451442219743*^9},
CellLabel->"Out[94]=",ExpressionUUID->"9db5c006-3d57-43c3-9e68-60e8bdc56281"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"ExportAnimation", "[",
RowBox[{"\"\<rps2.gif\>\"", ",", "rps2", ",",
RowBox[{"Panels", "\[Rule]", "3"}], ",",
RowBox[{"Show", "\[Rule]", "\"\<Agents\>\""}], ",", "\[IndentingNewLine]",
RowBox[{"ColorFunction", "\[Rule]", " ", "PastelHue"}], ",",
RowBox[{"Alignment", "\[Rule]", "Vertical"}]}], "]"}]], "Input",
CellChangeTimes->{{3.77244919251103*^9, 3.7724491949091387`*^9}, {
3.7724492539171753`*^9, 3.77244925444055*^9}, {3.772449284958643*^9,
3.7724492872208223`*^9}, {3.772449342082395*^9, 3.772449359742588*^9},
3.772451911243168*^9},ExpressionUUID->"defb45cc-a77b-4645-b0da-\
14ef91150d31"],
Cell[BoxData["\<\"rps_short.gif\"\>"], "Output",
CellChangeTimes->{
3.772449259469489*^9, {3.7724492929060097`*^9, 3.772449315675478*^9},
3.772449361743685*^9, 3.77244997164375*^9},
CellLabel->"Out[85]=",ExpressionUUID->"6b4f2f77-66ca-42fc-af52-b74230bed4d6"]
}, Open ]]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["Prisoner's Dilemma", "Section",
CellChangeTimes->{{3.49646153814987*^9,
3.49646154380597*^9}},ExpressionUUID->"0e2d99d9-9bbc-413c-b128-\
5905e84423f8"],
Cell[CellGroupData[{
Cell["Clusters of co-operators", "Subsection",
CellChangeTimes->{{3.496461663885725*^9,
3.4964618005559683`*^9}},ExpressionUUID->"2042e838-537d-4937-94b6-\
652d95a95cd6"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"pd1", "=",
RowBox[{"Simulate", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"InitialPopulation", "\[Rule]",
RowBox[{"Randomized", "[",
RowBox[{
RowBox[{
RowBox[{"{",
RowBox[{"1", ",", "1"}], "}"}], "\[Rule]",
RowBox[{"{",
RowBox[{
RowBox[{"-", "1"}], ",", "1"}], "}"}]}], ",", " ",
RowBox[{"\"\<Smoothing\>\"", "\[Rule]", "2"}]}], "]"}]}], ",",
"\[IndentingNewLine]",
RowBox[{"Payoff", "\[Rule]", "PrisonersDilemma"}], ",",
RowBox[{"AgentType", "\[Rule]", "\"\<Constant\>\""}], ",",
"\[IndentingNewLine]",
RowBox[{"Neighborhood", "\[Rule]", "8"}], ",",
RowBox[{"Temperature", "\[Rule]",
RowBox[{"1", "/", "5"}]}]}], "]"}]}], ";"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{"Visualize", "[",
RowBox[{"pd1", ",",
RowBox[{"Panels", "\[Rule]",
RowBox[{"{",
RowBox[{"1", ",", "20", ",", "50"}], "}"}]}], ",",
RowBox[{"Show", "\[Rule]", "\"\<Agents\>\""}], ",", "\[IndentingNewLine]",
RowBox[{"ColorRules", "\[Rule]",
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{"-", "1"}], "\[Rule]",
RowBox[{"Darker", "[",
RowBox[{"Red", ",", "0.05"}], "]"}]}], ",",
RowBox[{"0", "\[Rule]", "LightBlue"}], ",",
RowBox[{"1", "\[Rule]",
RowBox[{"Lighter", "[",
RowBox[{"Blue", ",", "0.5"}], "]"}]}]}], "}"}]}], ",",
"\[IndentingNewLine]",
RowBox[{"Alignment", "\[Rule]", "Vertical"}]}], "]"}]}], "Input",
CellChangeTimes->{{3.496303217864616*^9, 3.4963035447481947`*^9}, {
3.496304749220518*^9, 3.496304752779894*^9}, {3.496306639335744*^9,
3.496306722964306*^9}, {3.49630754212731*^9, 3.496308066557444*^9}, {
3.4963089705679207`*^9, 3.4963095034783373`*^9}, {3.496310618494952*^9,
3.496310861239223*^9}, {3.496461670264716*^9, 3.4964618344094763`*^9}},
CellLabel->"In[8]:=",ExpressionUUID->"d8a6f798-b97e-4b7c-bb42-c927bf44e031"],
Cell[BoxData[
TagBox[GridBox[{
{
TemplateBox[{GraphicsBox[
RasterBox[CompressedData["
1:eJztlsFpA0EQBA+Uh8GRXA4OwWB9nbIiEA7BWO2PbFawYve2ZqYbhI56iJma
htPr++fbx2nbtpffz8/z+Zbrvv1JiyuX/f77a+/9nShc+b/vbE7zMNsbbf6s
XDm+zy2e1Q9tr6xccZ/d55pcqdPnUR5oc9J8RuFKnZ7bM3OeKP5bnLZvdJ80
bv9juX2u5TT/We9iP2s5rc9Z71ttXxqn9TZ6H6LMaf4cz9rnKHPO5vYgHqXn
fu+IV9u3l9N6Ep0r+e64aq9RnNaT6FyJe6/Z88/mtD6YH8MVTg9HcZpn82O4
wunhKL7KG+2+q+5ebd/ZnObBdxS3hxzc93qOV/MQZV/3tiaP/j6izWO+lq/q
M40rdd5f1Titb7Tetnj0+atxWj+z9jartxb3HR/z3r16OW0vmn/zsVyJ22fa
POZrucL5nzab0/zTuJLPZ+9eNE7zGYUr+Tz37kXjNJ9R7kLbNwr/BkHTU0w=
"], {{0, 0},
Offset[{150, 150}, {0, 0}]}, {0, 1}], ImageSize -> {150, 150},
PlotRange -> {{0, 150}, {0, 150}}, PlotRangeClipping -> True, Frame ->
False, FrameLabel -> {None, None},
FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle ->
Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2},
"HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}},
"DefaultPlotStyle" -> Automatic}],"\"t = 1\""},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )],
TemplateBox[{GraphicsBox[
RasterBox[CompressedData["
1:eJzt1sGJAkEYROEB81gwksnBEBb0aspGIBuCrOVF4fcgPduve1+BKN9prC5m
Zv99Phx3y7J8PT6/v0/3XNflJf/Nk8v6/P2z0pzWm870hLPbymm96UxPOLut
nNabzvSEs9vKab3RPLHPhLPbymm90TyxT30sT7xv6GN54vNRn8MTzp4rp/Wm
Mz3h7HZrp/Wvt/WEs7etnda/3tYTzt62dlr/eltP3JU+tyfumdYz7fpH8cTd
2vMcntjbKHtu5bR+3DPTE85uK6f1RvPEc2n1v7Z2Wm80TzwXWv+06xzFE+8/
+hyezLdb2vXof+PJuHumXY/e1xPO+0Yvp52L/pknnF31ctq56J95wtlVL6ed
i97XE84+K6f1puu6rr/3xOeFzvSE855TOa03nekJZ7eV03qj+Q3Mum4E
"], {{0, 0},
Offset[{150, 150}, {0, 0}]}, {0, 1}], ImageSize -> {150, 150},
PlotRange -> {{0, 150}, {0, 150}}, PlotRangeClipping -> True, Frame ->
False, FrameLabel -> {None, None},
FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle ->
Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2},
"HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}},
"DefaultPlotStyle" -> Automatic}],"\"t = 20\""},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )],
TemplateBox[{GraphicsBox[
RasterBox[CompressedData["
1:eJzt2cGpAkEQhOEB8xCMZHMwBEGvpmwEYgii5UGFXQS7Z2tm/oKH8p16uuv0
3B3O++OmlLJ9/T2+n565TuUrvbpymT4/b1Pr7rZnPNYVn76t5W53wWNd8emP
2zz4sivsea2eu72rlb214m77p8/LPveubO91ztbv5fbeXveTPWf2/HgdV/z7
kD1n9vx4HVfGuXvr8+PLrozTZxzHcRzHcRz/xRX+D9y6K+PsP/td2e7WHzdX
uEvUu7LdbW9urnCXqHdlu9ve3FzhXq3Pj79nnN7ifbtCn/E+XKHPOI7jOI7j
OI7jOI7jOP6PKz6/6825297wWFd8+pbtbvvHY13x6VuUu+0Zr+OKTw+j3G3P
a/kdhaByPA==
"], {{0, 0},
Offset[{150, 150}, {0, 0}]}, {0, 1}], ImageSize -> {150, 150},
PlotRange -> {{0, 150}, {0, 150}}, PlotRangeClipping -> True, Frame ->
False, FrameLabel -> {None, None},
FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle ->
Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2},
"HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}},
"DefaultPlotStyle" -> Automatic}],"\"t = 50\""},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )]}
},
AutoDelete->False,
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}],
"Grid"]], "Output",
CellChangeTimes->{{3.496303308300723*^9, 3.4963034982636023`*^9}, {
3.496304745763769*^9, 3.496304758478446*^9}, {3.496306645229192*^9,
3.4963067248297243`*^9}, {3.496307762521914*^9, 3.496308068076627*^9}, {
3.4963089727548857`*^9, 3.496309505687379*^9}, {3.4963106206320343`*^9,
3.4963108684120903`*^9}, {3.496461807663615*^9, 3.496461835833116*^9},
3.772448300031336*^9},
CellLabel->"Out[9]=",ExpressionUUID->"81708d69-139b-446c-ae28-e758277ece61"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"ExportAnimation", "[",
RowBox[{"\"\<pd.gif\>\"", ",", "pd1", ",",
RowBox[{"Panels", "\[Rule]", "3"}], ",",
RowBox[{"Show", "\[Rule]", "\"\<Agents\>\""}], ",", "\[IndentingNewLine]",
RowBox[{"ColorRules", "\[Rule]",
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{"-", "1"}], "\[Rule]",
RowBox[{"Darker", "[",
RowBox[{"Red", ",", "0.05"}], "]"}]}], ",",
RowBox[{"0", "\[Rule]", "LightBlue"}], ",",
RowBox[{"1", "\[Rule]",
RowBox[{"Lighter", "[",
RowBox[{"Blue", ",", "0.5"}], "]"}]}]}], "}"}]}], ",",
RowBox[{"Alignment", "\[Rule]", "Vertical"}]}], "]"}]], "Input",
CellChangeTimes->{{3.772448304566283*^9, 3.772448308775845*^9},
3.7724497602773952`*^9},
CellLabel->"In[86]:=",ExpressionUUID->"ccdf9ef6-60b4-48a4-ad18-86204cdbfe89"],
Cell[BoxData["\<\"pd.gif\"\>"], "Output",
CellChangeTimes->{3.772448309636764*^9, 3.7724485357840223`*^9,
3.772449765583794*^9, 3.772449976306163*^9},
CellLabel->"Out[86]=",ExpressionUUID->"ef51abc0-1813-4419-94c1-94a0acc4d207"]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["Takeover by defectors", "Subsection",
CellChangeTimes->{{3.496461656180499*^9,
3.496461846371962*^9}},ExpressionUUID->"fbc42514-bb19-4dde-a0a8-\
b4d260d75748"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"pd2", "=",
RowBox[{"Simulate", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"InitialPopulation", "\[Rule]",
RowBox[{"Randomized", "[",
RowBox[{
RowBox[{
RowBox[{"{",
RowBox[{"1", ",", "2"}], "}"}], "\[Rule]",
RowBox[{"{",
RowBox[{
RowBox[{"-", "1"}], ",", "1"}], "}"}]}], ",", " ",
RowBox[{"\"\<Smoothing\>\"", "\[Rule]", "2"}]}], "]"}]}], ",",
"\[IndentingNewLine]",
RowBox[{"Payoff", "\[Rule]", "PrisonersDilemma"}], ",",
RowBox[{"AgentType", "\[Rule]", "\"\<Constant\>\""}], ",",
"\[IndentingNewLine]",
RowBox[{"Neighborhood", "\[Rule]", "6"}], ",",
RowBox[{"Temperature", "\[Rule]", "1"}]}], "]"}]}], ";"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{"Visualize", "[",
RowBox[{"pd2", ",",
RowBox[{"Panels", "\[Rule]",
RowBox[{"{",
RowBox[{"1", ",", "10", ",", "20"}], "}"}]}], ",",
RowBox[{"Show", "\[Rule]", "\"\<Agents\>\""}], ",", "\[IndentingNewLine]",
RowBox[{"ColorRules", "\[Rule]",
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{"-", "1"}], "\[Rule]",
RowBox[{"Darker", "[",
RowBox[{"Red", ",", "0.05"}], "]"}]}], ",",
RowBox[{"0", "\[Rule]", "LightBlue"}], ",",
RowBox[{"1", "\[Rule]",
RowBox[{"Lighter", "[",
RowBox[{"Blue", ",", "0.5"}], "]"}]}]}], "}"}]}], ",",
"\[IndentingNewLine]",
RowBox[{"Alignment", "\[Rule]", "Vertical"}]}], "]"}]}], "Input",
CellChangeTimes->{{3.496303217864616*^9, 3.4963035447481947`*^9}, {
3.496304749220518*^9, 3.496304752779894*^9}, {3.496306639335744*^9,
3.496306722964306*^9}, {3.49630754212731*^9, 3.496308066557444*^9}, {
3.4963089705679207`*^9, 3.4963095034783373`*^9}, {3.496310618494952*^9,
3.496310861239223*^9}, {3.4964617238329697`*^9, 3.4964617338197603`*^9}},
CellLabel->"In[11]:=",ExpressionUUID->"04df481b-83b3-4c8c-bbfd-922f3753cc76"],
Cell[BoxData[
TagBox[GridBox[{
{
TemplateBox[{GraphicsBox[
RasterBox[CompressedData["
1:eJzt2rsJgDAUBdCAewhO4g6OIGjryk4gjiB+Gq0UP0Q9D0LMafKES4qQrGyK
KgkhpMsYv+dq8/Xc55xzzr/t9VTdst5WPH1yvie3Rz22/+L8TM5j659zzjnn
nHPOOeecc36fv/2e8C39u6flT+bnqlxdta+c85jPebnlnHPOOeecc84555xz
zjnnnHPOOeecc84553vcu1P+Zx8Ah1kQ7A==
"], {{0, 0},
Offset[{150, 150}, {0, 0}]}, {0, 1}], ImageSize -> {150, 150},
PlotRange -> {{0, 150}, {0, 150}}, PlotRangeClipping -> True, Frame ->
False, FrameLabel -> {None, None},
FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle ->
Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2},
"HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}},
"DefaultPlotStyle" -> Automatic}],"\"t = 1\""},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )],
TemplateBox[{GraphicsBox[
RasterBox[CompressedData["
1:eJztmOGpQjEMRi+4h+Akd4c3gqB/XdkJ5I0gWv8ItlBImi/tCYhykDZJT9ur
p/Pt73LYtu34eb0+l7jv3+//uxq/vuOxbz9j/DjZea0PWXitLivunae3z6t5
btX/qHPGe73U9u9qfvby7D57czVv8XxNruYVPsNH3iNZeInx+7p3Xnibq3ml
5kmWPKN4VF1qvmVZd+/8ve8Lq3Gi1lHNQzU/rXhUf9T86R3HOx/8bHO1cyBq
X2SZF5/bXK3P8DG8hI6HNa7WN7gmL4GHVv1Ry39WXkLHW6txvOetfb+Xq/kw
677uzbM3f6tx1OpVq0utP7OeS73zZlkvtbqy9E0tH+/8o/KMqlftvJp1Xaz4
av3Jci9452OVv1qe8Da3WsfsPsPhcDh8Tc7vCPhMHD/hGXmW/y3hcA9v1eqC
z8Gtnm/xHK58fmbhJXT6D7fl3p7gLVzZ2yifa+PD5+Bq9zgewlfw+QlnpjvQ
"], {{0, 0},
Offset[{150, 150}, {0, 0}]}, {0, 1}], ImageSize -> {150, 150},
PlotRange -> {{0, 150}, {0, 150}}, PlotRangeClipping -> True, Frame ->
False, FrameLabel -> {None, None},
FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle ->
Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2},
"HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}},
"DefaultPlotStyle" -> Automatic}],"\"t = 10\""},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )],
TemplateBox[{GraphicsBox[
RasterBox[CompressedData["
1:eJzt28EJwkAQBdAF+xCsJD1YgqBXW7YCsQTR8aKQQ3RMJsn7IMpjMbOzcwkk
u8N5f9y01ravz+P36Zlr1z7Cx/HIpXv/vnVZXm2/fNkeMc98nR4xz5xzzjnn
nHPOOeecc84555xzzjnnnHPOOeecc86n9Yjn2/kyPOK9pKy+Za1fm0f+995c
n1frQzWP6Kf+59aZVX/WdbPqWZtHfu/n0PXV9jUXrzY/1c537v8zVZ1Dvdo8
8FyP1Dn3vnqyvFr/+XceqT8n1erh8/KI+zW+bI/UmZOh9fStr7YvPo5Hxj/3
vutmebU+Z/kde6iBJA==
"], {{0, 0},
Offset[{150, 150}, {0, 0}]}, {0, 1}], ImageSize -> {150, 150},
PlotRange -> {{0, 150}, {0, 150}}, PlotRangeClipping -> True, Frame ->
False, FrameLabel -> {None, None},
FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle ->
Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2},
"HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}},
"DefaultPlotStyle" -> Automatic}],"\"t = 20\""},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )]}