-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1123 lines (929 loc) · 64.2 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="keywords" content="Evolutionary Game Theory, Agent-based Modelling, NetLogo, Simulation, Markov chains, Evolution, Games">
<meta name="description" content="ABED-1pop is a modeling framework designed to simulate the evolution of populations of agents who play a symmetric 2-player game and, from time to time, are given the opportunity to revise their strategy.">
<meta name="author" content="Luis R. Izquierdo, Segismundo S. Izquierdo & Bill Sandholm">
<link rel="icon" href="./assets/img/favicon.ico">
<!--<div>Icons made by <a href="http://www.freepik.com" title="Freepik">Freepik</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>-->
<title>Abed-1pop</title>
<link href="./assets/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- Bootstrap core CSS -->
<link href="./assets/css/bootstrap.min.css" rel="stylesheet">
<link href="./assets/css/bootstrap-theme.min.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="./assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<!-- Custom styles -->
<link href="./assets/css/abed.css" rel="stylesheet">
</head>
<body data-spy="scroll" data-target="#sidebar" data-offset="0">
<!-- Fixed navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="#" class="navbar-brand scroll-top"><i class="fa fa-users"></i> Abed-1pop </a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<!--<li><a href="https://github.com/luis-r-izquierdo/abed-1pop/archive/v1.0.zip">Download</a></li>-->
<li><a href="https://github.com/luis-r-izquierdo/abed-1pop/archive/master.zip">Download</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Navigation <span class="caret"></span></a>
<ul class="dropdown-menu multi-level">
<li><a href="#install" class="scroll-link">How to install <i>Abed-1pop</i></a></li>
<li class="dropdown-submenu">
<a href="#overview" class="scroll-link dropdown-toggle" data-toggle="dropdown" tabindex="-1">Overview</a>
<ul class="dropdown-menu">
<li><a href="#selection-or-revisers" class="scroll-link">Selection of revisers</a></li>
<li><a href="#computation" class="scroll-link">Computation of payoffs</a></li>
<li><a href="#revision" class="scroll-link">Strategy revision</a></li>
</ul>
</li>
<li class="dropdown-submenu">
<a href="#parameters" class="scroll-link dropdown-toggle" data-toggle="dropdown" tabindex="-1">Parameters</a>
<ul class="dropdown-menu">
<li><a href="#par-population" class="scroll-link">Population setup</a></li>
<li><a href="#par-when" class="scroll-link">When to revise</a></li>
<li><a href="#par-payoffs" class="scroll-link">Payoffs</a></li>
<li><a href="#par-how" class="scroll-link">How to revise</a></li>
<li><a href="#par-files" class="scroll-link">Parameter files</a></li>
</ul>
</li>
<li class="dropdown-submenu">
<a href="#usage" class="scroll-link dropdown-toggle" data-toggle="dropdown" tabindex="-1">How to use it</a>
<ul class="dropdown-menu">
<li><a href="#running" class="scroll-link">Running the model</a></li>
<li><a href="#plots" class="scroll-link">Plots and monitors</a></li>
</ul>
</li>
<li><a href="#license" class="scroll-link">License</a></li>
<li><a href="#extending" class="scroll-link">Extending the model</a></li>
<li><a href="#acknowledgements" class="scroll-link">Acknowledgements</a></li>
<li><a href="#references" class="scroll-link">References</a></li>
<li><a href="#howtocite" class="scroll-link">How to cite</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" tabindex="-1">About us <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a target="_blank" href="http://luis.izqui.org">Luis R. Izquierdo</a></li>
<li><a target="_blank" href="http://segis.izqui.org/">Segismundo S. Izquierdo</a></li>
<li><a target="_blank" href="http://www.ssc.wisc.edu/~whs/">Bill Sandholm</a></li>
</ul>
</li>
<li><a href="https://luis-r-izquierdo.github.io/abed-2pop/">Abed-2pop</a>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</nav>
<div class="container theme-showcase" role="main">
<div class="row">
<div class="col-sm-10 ">
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<h1><big>A</big>gent-<big>B</big>ased <big>E</big>volutionary <big>D</big>ynamics in <big>1</big> population</h1>
<p><strong>Abed-1pop</strong> is a modeling framework designed to simulate the evolution of a population of agents who play a symmetric 2-player game and, from time to time, are given the opportunity to revise their strategy</p>
</div>
<div id="install" class="section">
<h1>How to install <i>Abed-1pop</i></h1>
</div>
<br>
<div class="row">
<div class="col-xs-12">
<p>To use <strong>Abed-1pop</strong>, you will have to install <a target="_blank" href="http://ccl.northwestern.edu/netlogo/">NetLogo (free and open source) 6.0.1 or higher</a> and download <a href="https://github.com/luis-r-izquierdo/abed-1pop/archive/master.zip">this <i>zip</i> file</a>. The <i>zip</i> file contains the model itself (abed-1pop.nlogo) and also this very webpage (which contains a description of the model). To run the model, you just have to click on the file abed-1pop.nlogo. The figure below shows Abed-1pop's interface.</p>
</div>
<div class="col-xs-12">
<a href="https://github.com/luis-r-izquierdo/abed-1pop/archive/master.zip"><img src="./assets/img/abed-1pop.png" alt="abed-1pop-interface" class="img-center img-responsive"></a>
</div>
</div>
<div id="overview" class="section">
<h1>Overview</h1>
</div>
<br>
<div class="row">
<div class="col-xs-12 col-sm-4 col-sm-push-8">
<div class="well">
<p>We use bold green fonts to denote
<parameter>parameters</parameter> (i.e. variables that can be set by the user) and brown fonts to denote different
<value>values</value> that a
<parameter>parameter</parameter> might take.</p>
</div>
</div>
<div class="col-xs-12 col-sm-8 col-sm-pull-4">
<p><strong>Abed-1pop</strong> is a modeling framework designed to simulate the evolution of a population of
<parameter>n-of-agents</parameter> agents who recurrently play a symmetric 2-player game defined by a
<parameter>payoff-matrix</parameter>. Agents use pure strategies only, and they occasionally revise their strategy.</p>
<p>The simulation runs in discrete time-steps called ticks. Within each tick:</p>
<ol>
<li>The set of revising agents is chosen</li>
<li>The game is played by the revising agents and all the agents involved in their revision</li>
<li>The revising agents simultaneously update their strategies</li>
</ol>
<p>This sequence of events, which is explained below in detail, is repetead iteratively.</p>
</div>
<div class="col-xs-12">
<br>
<h2 id="selection-or-revisers" style="border-bottom: 1px solid black;padding-top: 60px;margin-top: -60px;" class="section">Selection of revising agents</h2>
</div>
<div class="col-xs-12">
<p>All agents are equally likely to revise their strategy in every tick. There are two ways in which the set of revising agents can be chosen:</p>
<ul>
<li>By setting parameter
<parameter>prob-revision</parameter>, which is the probability that each individual agent revises his strategy in every tick.
</li>
<li>By setting parameter
<parameter>n-of-revisions-per-tick</parameter>, which is the number of randomly selected agents that will revise their strategy in every tick.</li>
</ul>
</div>
<div class="col-xs-12">
<br>
<h2 id="computation" style="border-bottom: 1px solid black;padding-top: 60px;margin-top: -60px;" class="section">Computation of payoffs</h2>
</div>
<div class="col-xs-12 col-sm-6">
<p>The payoff that each agent obtains in each tick is computed as the average payoff over
<parameter>n-of-trials</parameter> matches (where the agent uses his particular pure strategy, and his -randomly chosen- counterparts theirs).</p>
<blockquote class="blockquote ">
<footer class="blockquote-footer">Note that two agents using the same strategy may get different payoffs because they may encounter different counterparts in their trials.</footer>
</blockquote>
</div>
<div class="col-xs-12 col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Specifying how payoffs are computed</h3>
</div>
<div class="panel-body">
<p>There are parameters to specify:</p>
<ul>
<li>the
<parameter>n-of-trials</parameter> agents make,</li>
<li>whether these are conducted with or without replacement (
<parameter>trials-with-replacement?</parameter> ), and</li>
<li>whether agents may play with themselves or not (
<parameter>self-matching?</parameter> ).</li>
</ul>
</div>
</div>
</div>
<div class="col-xs-12">
<h2 id="revision" style="border-bottom: 1px solid black;padding-top: 60px;margin-top: -60px;" class="subsection">Strategy revision</h2>
</div>
<div class="col-xs-12">
<p>Agents are occasionally given the opportunity to revise their strategy. The specific protocol used by revising agents is determined mainly by three parameters: </p>
<ul>
<li>
<parameter>candidate-selection</parameter>, which indicates whether the protocol is
<value>imitative</value> or
<value>direct</value> (Sandholm, 2010, p. 9),
</li>
<li>
<parameter>n-of-candidates</parameter>, which determines the number of candidates (agents or strategies) that revising agents will consider to update their strategy, and
</li>
<li>
<parameter>decision-method</parameter>, which determines how to single out one instance out of the set of candidates. <i>Abed-1pop</i> implements the following methods:
<value>best</value>,
<value>logit</value>,
<value>positive-proportional</value>,
<value>pairwise-difference</value>,
<value>linear-dissatisfaction</value> and
<value>linear-attraction</value>.
</li>
</ul>
<p>We briefly explain the meaning of each of these terms below.</p>
</div>
<div class="col-xs-12">
<div class="subsection">
<h2>Imitative Protocols</h2>
</div>
</div>
<div class="col-xs-12 col-sm-5">
<p>
Under
<value>imitative</value> protocols, revising agents observe what other agents are doing and their payoff, and use this information to update their strategy. Specifically, revising agents will compile a multiset of
<parameter>n-of-candidates</parameter> agents to copy the strategy of one of them. The revising agent is always part of this multiset of agents. The selection of the other (
<parameter>n-of-candidates</parameter> - 1 ) agents is conducted randomly, so popular strategies in the population are more likely to be observed than less popular ones. Once the multiset of candidate agents has been compiled, the revising agent will use one of various possible
<parameter>decision-method</parameter>s (see below) to single out one of the candidates and copy his strategy.</p>
</div>
<div class="col-xs-12 col-sm-7">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Imitative protocols: Specifying how to compile the set of candidate agents to copy </h3>
</div>
<div class="panel-body">
<p>There are parameters to specify:</p>
<ul>
<li>the number of candidate agents that revising agents will consider to copy (
<parameter>n-of-candidates</parameter> ),</li>
<li>whether the selection of other candidates (besides the revising agent) is conducted with or without replacement (
<parameter>imitatees-with-replacement?</parameter> ), and</li>
<li>whether the selection of other candidates (besides the revising agent) considers the revising agent again or not (
<parameter>consider-imitating-self?</parameter> ).</li>
</ul>
</div>
</div>
</div>
<div class="col-xs-12">
</div>
<div class="col-xs-12 col-sm-4 col-sm-push-8" style="text-align:right">
<div class="subsection">
<h2 style="text-align:right">Direct Protocols</h2>
</div>
<p>In contrast, under
<value>direct</value> protocols, revising agents choose candidate strategies directly, so a strategy's popularity does not directly influence the probability with which it is considered. Specifically, the revising agent considers a set of
<parameter>n-of-candidates</parameter> strategies (including his own), tests them, and selects one of them according to one of various possible
<parameter>decision-method</parameter>s (see below).
</p>
</div>
<div class="col-xs-12 col-sm-8 col-sm-pull-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Direct protocols: Specifying how to test strategies</h3>
</div>
<div class="panel-body">
<p>There are parameters to specify:</p>
<ul>
<li>the number of strategies that revising agents consider, including their current strategy (
<parameter>n-of-candidates</parameter> ), </li>
<li>whether the strategies in the test set are compared according to a payoff computed using one single sample of agents (i.e. the same set of agents for every strategy), or whether the payoff of each strategy in the test set is computed using a freshly drawn random sample of agents (
<parameter>single-sample?</parameter> ).</li>
</ul>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="subsection">
<h2>Decision methods</h2>
</div>
<p>A
<parameter>decision-method</parameter> is a procedure that singles out:</p>
<ul>
<li>one particular agent out of a set of candidates, whose strategy will be adopted by the revising agent (in
<value>imitative</value> protocols), or</li>
<li>one particular strategy out of a set of candidate strategies, which will be adopted by the revising agent (in
<value>direct</value> protocols).</li>
</ul>
<p>The selection is based on the (average) payoff obtained by each of the candidates (agents or strategies) in the input set. In
<value>imitative</value> protocols the set of candidates is the multiset of
<parameter>n-of-candidates</parameter> agents previously compiled, which always includes the revising agent. In
<value>direct</value> protocols the set of candidates is the set of
<parameter>n-of-candidates</parameter> strategies previously compiled, which always includes the revising agent's strategy. <i>Abed-1pop</i> implements six different
<parameter>decision-method</parameter>s:</p>
<ul>
<li>
<value>best</value>: The candidate with the highest payoff is selected. Ties are resolved according to the procedure indicated with parameter
<parameter>tie-breaker</parameter>.
</li>
<li>
<value>logit</value>: A random weighted choice is conducted among the candidates. The weight for each candidate is <i>e</i><sup>(<i>payoff</i> / (10 ^ <parameter>log-noise-level</parameter>))</sup>.
</li>
<li>
<value>positive-proportional</value>: A candidate is randomly selected with probabilities proportional to payoffs. Thus, payoffs should be non-negative if this
<parameter>decision-method</parameter> is used.
</li>
<li>
<value>pairwise-difference</value>: In this method the set of candidates contains two elements only: the one corresponding to the revising agent's own strategy (or to himself in
<value>imitative</value> protocols) and another one. The revising agent adopts the other candidate strategy only if the other candidate's payoff is higher than his own, and he does so with probability proportional to the payoff difference.
</li>
<li>
<value>linear-dissatisfaction</value>: In this method the set of candidates contains two elements only: the one corresponding to the revising agent's own strategy (or to himself in
<value>imitative</value> protocols) and another one. The revising agent adopts the other candidate strategy with probability proportional to the difference between the maximum possible payoff and his own payoff. (The other candidate's payoff is ignored.)
</li>
<li>
<value>linear-attraction</value>: In this method the set of candidates contains two elements only: the one corresponding to the revising agent's own strategy (or to himself in
<value>imitative</value> protocols) and another one. The revising agent adopts the other candidate strategy with probability proportional to the difference between the other candidate's payoff and the minimum possible payoff. (The revising agent's payoff is ignored.)
</li>
</ul>
</div>
</div>
<div id="parameters" class="section">
<h1>Parameters</h1>
</div>
<br>
<div id="par-population" class="subsection">
<h2>Parameters to set up the population and its initial strategy distribution</h2>
</div>
<div class="row well">
<div class="col-md-5">
<img src="./assets/img/population-setup.png" alt="population-setup" class="img-center img-responsive">
<br>
</div>
<div class="col-md-7">
<ul class="spaced">
<li>If
<parameter>random-initial-condition?</parameter> is
<value>On</value>, the population will consist of
<parameter>n-of-agents</parameter> agents, each of them with a random initial strategy.
</li>
<li>If
<parameter>random-initial-condition?</parameter> is
<value>Off</value>, the population will be created from the list given as
<parameter>initial-condition</parameter>. Let this list be [x1 x2 ... xn]; then the initial population will consist of x1 agents playing strategy 1, x2 agents playing strategy 2, ... , and xn agents playing strategy n. The value of
<parameter>n-of-agents</parameter> is then set to the total number of agents in the population.
</li>
</ul>
</div>
<div class="col-md-12">
<blockquote class="blockquote ">
<footer class="blockquote-footer">The value of
<parameter>n-of-agents</parameter> can be changed at runtime with immediate effect over the model. If
<parameter>n-of-agents</parameter> is reduced, the necessary number of (randomly selected) agents are killed. If
<parameter>n-of-agents</parameter> is increased, the necessary number of (randomly selected) agents are cloned.</footer>
</blockquote>
</div>
</div>
<div id="par-when" class="subsection">
<h2>Parameters that determine when agents revise their strategy</h2>
</div>
<div class="row well">
<div class="col-md-5">
<img src="./assets/img/revision-setup.png" alt="revision-setup" class="img-center img-responsive">
<br>
</div>
<div class="col-md-7">
<ul class="spaced">
<li>If
<parameter>use-prob-revision?</parameter> is
<value>On</value>, each individual agent revises his strategy with probability
<parameter>prob-revision</parameter> in every tick.
</li>
<li>If
<parameter>use-prob-revision?</parameter> is
<value>Off</value>, then
<parameter>n-of-revisions-per-tick</parameter> agents are randomly selected to revise their strategy in every tick.
</li>
</ul>
<p>The value of these three parameters can be changed at runtime with immediate effect on the model.</p>
</div>
</div>
<div id="par-payoffs" class="subsection">
<h2>Parameters that determine how payoffs are calculated</h2>
</div>
<div class="row well">
<div class="col-xs-12 col-sm-7">
<p>This flowchart is a summary of all the parameters that determine how payoffs are calculated. </p>
<p>The idea is to start at the top of the flowchart, give a value to every parameter you encounter on your way and, at the decision nodes (i.e. the red diamonds), select the exit arrow whose <b>[label]</b> indicates the value of the parameter you have just chosen. Thus, note that, depending on your choices, it may not be necessary to set the value of all parameters. </p>
<p>Every parameter is explained below </p>
</div>
<div class="col-xs-12 col-sm-5">
<img src="./assets/img/payoffs-flowchart.png" alt="payoffs-flowchart" class="img-center img-responsive" style="max-width: 200px;">
<br>
</div>
</div>
<div class="row well">
<div class="col-md-5">
<img src="./assets/img/payoff-matrix.png" alt="payoff-matrix" class="img-center img-responsive">
<br>
</div>
<div class="col-md-7">
<p>Payoff matrix for the symmetric game. Entry A<sub><i>ij</i></sub> in the matrix denotes the payoff obtained by player row when he chooses strategy <i>i</i> and his counterpart uses strategy <i>j</i>. The number of strategies is assumed to be the number of rows (and columns) in this square matrix.</p>
</div>
</div>
<div class="row well">
<div class="col-md-push-8 col-md-4">
<img src="./assets/img/self-matching.png" class="img-center img-responsive" alt="self-matching">
<br>
</div>
<div class="col-md-pull-4 col-md-8">
<ul>
<li>If
<parameter>self-matching?</parameter> is
<value>On</value>, agents can be matched with themselves. </li>
<li>If
<parameter>self-matching?</parameter> is
<value>Off</value>, agents cannot be matched with themselves. </li>
</ul>
</div>
</div>
<div class="row well">
<div class="col-md-push-8 col-md-4">
<img src="./assets/img/complete-matching.png" alt="complete-matching" class="img-center img-responsive">
<br>
</div>
<div class="col-md-pull-4 col-md-8">
<p>If
<parameter>complete-matching?</parameter> is
<value>On</value>, payoffs are calculated assuming that everyone plays with: </p>
<ul>
<li>Everyone, including themselves, if
<parameter>self-matching?</parameter> is
<value>On</value>.
</li>
<li>Everyone else, if
<parameter>self-matching?</parameter> is
<value>Off</value>.
</li>
</ul>
<p>If
<parameter>complete-matching?</parameter> is
<value>Off</value>, then parameters
<parameter>n-of-trials</parameter>,
<parameter>trials-with-replacement?</parameter> and
<parameter>single-sample?</parameter> become relevant.
</p>
</div>
</div>
<div class="row well">
<div class="col-md-4">
<img src="./assets/img/n-of-trials.png" alt="n-of-trials" class="img-center img-responsive">
<br>
</div>
<div class="col-md-8">
<p>Parameter
<parameter>n-of-trials</parameter> indicates the number of matches over which payoffs are computed. The user can set the value of this parameter only if
<parameter>complete-matching?</parameter> is
<value>Off</value>. </p>
</div>
</div>
<div class="row well">
<div class="col-md-4">
<img src="./assets/img/trials-with-replacement.png" alt="trials-with-replacement" class="img-center img-responsive">
<br>
</div>
<div class="col-md-8">
<p>Parameter
<parameter>trials-with-replacement?</parameter> indicates whether the sample of counterparts used to compute payoffs is taken with replacement (
<value>On</value> ) or without replacement (
<value>Off</value> ). The user can set the value of this parameter only if
<parameter>complete-matching?</parameter> is
<value>Off</value>. </p>
</div>
</div>
<div class="row">
<div class="alert alert-danger">
<p>We assume <strong>clever payoff evaluation</strong> (see Sandholm, 2010, section 11.4.2, pp. 419-421), i.e. when a revising agent tests a strategy <i>s</i> different from his current strategy, he assumes that he switches to this strategy <i>s</i> (so the population state changes), and then he computes the payoff he would get in this new state (i.e. he computes the actual payoff he would get if only he changed his strategy).
</p>
</div>
</div>
<div id="par-how" class="subsection">
<h2>Parameters that determine how agents revise their strategy</h2>
</div>
<div class="row well">
<div class="col-xs-12">
<p>With probability
<parameter>prob-mutation</parameter> the revising agent will select a random strategy. With probability (1 -
<parameter>prob-mutation</parameter>) he will revise his strategy following an algorithm which is mainly determined by the parameters shown in the flowchart below.</p>
<p>The idea is to start at the top of the flowchart, give a value to every parameter you encounter on your way and, at the decision nodes (i.e. the red diamonds), select the exit arrow whose <b>[label]</b> indicates the value of the parameter you have just chosen. Every parameter is explained below.</p>
</div>
<div class="col-xs-12 col-sm-offset-1 col-sm-10 col-lg-offset-2 col-lg-8">
<img src="./assets/img/revision-flowchart.png" alt="revision-flowchart" class="img-center img-responsive">
<br>
</div>
</div>
<div class="row well">
<p>
Parameter
<parameter>candidate-selection</parameter> indicates whether the protocol is
<value>imitative</value> or
<value>direct</value> (Sandholm, 2010, p. 9). Revising agents compile a multiset of candidate agents to imitate to (in
<value>imitative</value> protocols) or a set of candidate strategies they will consider adopting (in
<value>direct</value> protocols). The following describes how the multiset of candidates is formed. </p>
<div id="tab-panel">
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#imitative" data-toggle="tab">
<value>imitative</value>
</a>
</li>
<li>
<a href="#direct" data-toggle="tab">
<value>direct</value>
</a>
</li>
</ul>
<div class="tab-content clearfix">
<div class="tab-pane active" id="imitative">
<p>The multiset of candidate agents contains the revising agent (which is always included) plus a sample of (
<parameter>n-of-candidates</parameter> - 1 ) agents from the population. Two parameters determine how this sample is taken:</p>
<ul>
<li>
<parameter>imitatees-with-replacement?</parameter> indicates whether the sample is taken with or without replacement.</li>
<li>
<parameter>consider-imitating-self?</parameter> indicates whether the sample is taken from the whole population (i.e. including the reviser) or from the whole population excluding the reviser. Note that, in any case, the reviser is always part of the multiset of candidate agents at least once.</li>
</ul>
<blockquote class="blockquote">
<footer class="blockquote-footer">
To be sure, let <b>Sample(<i>n</i>, <i>p</i>, R)</b> denote a sample of
<i>n</i> = (
<parameter>n-of-candidates</parameter> - 1 ) elements from population <i>p</i> with replacement. Similarly, let <b>Sample(<i>n</i>, <i>p</i>, NR)</b> denote the same sampling procedure, but without replacement. Finally, let P denote the whole population of agents. Using this notation, the multiset of candidate agents will be formed by
<ul>
<li>reviser + Sample(<i>n</i>, P, R) ; if
<parameter>imitatees-with-replacement?</parameter> =
<value>On</value> and
<parameter>consider-imitating-self?</parameter> =
<value>On</value>.</li>
<li>reviser + Sample(<i>n</i>, P, NR) ; if
<parameter>imitatees-with-replacement?</parameter> =
<value>Off</value> and
<parameter>consider-imitating-self?</parameter> =
<value>On</value>.</li>
<li>reviser + Sample(<i>n</i>, P - reviser, R) ; if
<parameter>imitatees-with-replacement?</parameter> =
<value>On</value> and
<parameter>consider-imitating-self?</parameter> =
<value>Off</value>.</li>
<li>reviser + Sample(<i>n</i>, P - reviser, NR) ; if
<parameter>imitatees-with-replacement?</parameter> =
<value>Off</value> and
<parameter>consider-imitating-self?</parameter> =
<value>Off</value>.</li>
</ul>
</footer>
</blockquote>
</div>
<div class="tab-pane" id="direct">
<p>The set of candidate strategies contains the revising agent's own strategy plus (
<parameter>n-of-candidates</parameter> - 1 ) other strategies, selected at random.
</p>
</div>
</div>
</div>
</div>
<div class="row well">
<div class="col-md-3">
<img src="./assets/img/single-sample.png" class="img-center img-responsive" alt="single-sample">
<br>
</div>
<div class="col-md-9">
<p>Parameter
<parameter>single-sample?</parameter> is only relevant in direct protocols (i.e. if
<parameter>candidate-selection</parameter> is
<value>direct</value>). It indicates whether strategies being compared are tested against one single sample of agents (i.e. the same set of agents for every strategy), or whether the payoff of each strategy in the test-set is computed using a freshly drawn random sample of agents.</p>
</div>
<div class="col-md-12">
<p>The user can set the value of this parameter only if
<parameter>complete-matching?</parameter> is
<value>Off</value>. </p>
<blockquote class="blockquote">
<footer class="blockquote-footer">Note that when an agent tests a strategy, he assumes he adopts it, so if the agent himself is part of the sample, he will be playing with himself using the strategy under test.</footer>
</blockquote>
</div>
</div>
<div class="row well">
<p>
Parameter
<parameter>decision-method</parameter> determines which strategy the revising agent will adopt. </p>
<p>Specifically, the chosen
<parameter>decision-method</parameter> (i.e.
<value>best</value>,
<value>logit</value>,
<value>positive-proportional</value>,
<value>pairwise-difference</value>,
<value>linear-dissatisfaction</value> or
<value>linear-attraction</value>) selects one particular instance from the set of candidates previously compiled, based on the payoff obtained by each of the candidates. The revising agent will then adopt the strategy of the selected candidate.</p>
<div id="tab-panel">
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#best" data-toggle="tab">
<value>best</value>
</a>
</li>
<li>
<a href="#logit" data-toggle="tab">
<value>logit</value>
</a>
</li>
<li>
<a href="#positive-proportional" data-toggle="tab">
<value>positive-proportional</value>
</a>
</li>
<li>
<a href="#pairwise-difference" data-toggle="tab">
<value>pairwise-difference</value>
</a>
</li>
<li>
<a href="#linear-dissatisfaction" data-toggle="tab">
<value>linear-dissatisfaction</value>
</a>
</li>
<li>
<a href="#linear-attraction" data-toggle="tab">
<value>linear-attraction</value>
</a>
</li>
</ul>
<div class="tab-content clearfix">
<div class="tab-pane active" id="best">
<p>The candidate with the highest payoff is returned. Ties are resolved using the selected
<parameter>tie-breaker</parameter>. Possible values of
<parameter>tie-breaker</parameter> are:</p>
<ul class="spaced">
<li>
<value>stick-uniform</value>: If the current strategy of the revising agent is in the tie, the revising agent sticks to it. Otherwise, a random choice is made using the uniform distribution.</li>
<li>
<value>stick-min</value>: If the current strategy of the revising agent is in the tie, the revising agent sticks to it. Otherwise, the strategy with the minimum number is selected.</li>
<li>
<value>uniform</value>: A random choice is made using the uniform distribution.</li>
<li>
<value>min</value>: The strategy with the minimum number is selected.</li>
<li>
<p>
<value>random-walk</value>: This tie-breaker makes use of an auxiliary random walk that is running in the background. Let <i>N</i> be the number of agents in <i>Abed-1pop</i> and let <i>n</i> be the number of strategies. In the auxiliary random walk, there are <i>N</i> rw-agents, plus a set of <i>n</i> so-called committed rw-agents, one for each of the <i>n</i> strategies in <i>Abed-1pop</i>. The committed rw-agents never change strategy. In each iteration of this random walk, one uncommitted rw-agent is selected at random to imitate another (committed or uncommitted) rw-agent, also chosen at random. We run one iteration of this process per tick. When there is a tie in <i>Abed-1pop</i>, the relative frequency of each strategy in the auxiliary random walk is used as a weight to make a random weighted selection among the tied candidates.</p>
</li>
<blockquote class="blockquote ">
<footer class="blockquote-footer">The random-walk tie-breaker is inspired by section 11.4.3 in Sandholm (2010, pp. 421-423).</footer>
</blockquote>
</ul>
</div>
<div class="tab-pane" id="logit">
<p>A random weighted choice is conducted among the candidates. The weight for each candidate is <i>e</i><sup>(<i>payoff</i> / (10 ^ <parameter>log-noise-level</parameter>)</sup>. Recall that the payoff for each candidate is the average payoff over the
<parameter>n-of-trials</parameter> matches.</p>
<blockquote class="blockquote ">
<footer class="blockquote-footer">If
<parameter>log-noise-level</parameter> is large, choices under logit are nearly uniform. If
<parameter>log-noise-level</parameter> is small (i.e. negative and large in magnitude), choices resemble those made by
<value>best</value>, at least when the difference between the best and the second-best payoff is not too small (Sandholm, 2010, p. 128 & pp. 191-6).</footer>
</blockquote>
</div>
<div class="tab-pane" id="positive-proportional">
<p>A candidate is randomly selected, with probabilities proportional to payoffs. Because of this, when using
<value>positive-proportional</value>, payoffs should not be negative. Recall that the payoff for each candidate is the average payoff over the
<parameter>n-of-trials</parameter> matches.</p>
<blockquote class="blockquote ">
<footer class="blockquote-footer">This
<parameter>decision-method</parameter> can be used to model <i>frequency-dependent Moran processes</i> by setting, in addition:
<ul>
<li>
<parameter>candidate-selection</parameter> =
<value>imitative</value>,
</li>
<li>
<parameter>n-of-candidates</parameter> =
<parameter>n-of-agents</parameter>,
</li>
<li>
<parameter>imitatees-with-replacement?</parameter> =
<value>Off</value>,
</li>
<li>
<parameter>consider-imitating-self?</parameter> =
<value>Off</value>,
</li>
<li>
<parameter>complete-matching?</parameter> =
<value>On</value>, and
</li>
<li>
<parameter>self-matching?</parameter> =
<value>Off</value>.
</li>
</ul>
</footer>
</blockquote>
</div>
<div class="tab-pane" id="pairwise-difference">
<p>In
<value>pairwise-difference</value>, the agent always considers exactly two candidates (one corresponding to his own strategy or to himself, and another one), i.e., the value of
<parameter>n-of-candidates</parameter> is automatically set to 2.</p>
<p>The revising agent will consider adopting the other candidate strategy only if the other candidate's payoff is higher than his own, and he will actually adopt it with probability proportional to the payoff difference. In order to turn the difference in payoffs into a meaningful probability, we divide the payoff difference by the maximum possible payoff minus the minimum possible payoff.</p>
<blockquote class="blockquote ">
<footer class="blockquote-footer">If
<parameter>complete-matching?</parameter> is
<value>On</value>, the mean dynamics for large populations of the
<value>imitative</value>
<value>pairwise-difference</value> protocol (sometimes called <i>pairwise proportional imitation</i>) is the replicator dynamics up to a speed factor (see Sandholm, 2010, pp. 126-7).</footer>
</blockquote>
</div>
<div class="tab-pane" id="linear-dissatisfaction">
<p>In
<value>linear-dissatisfaction</value>, the agent always considers exactly two candidates (one corresponding to his own strategy or to himself, and another one), i.e., the value of
<parameter>n-of-candidates</parameter> is automatically set to 2.</p>
<p>The revising agent will adopt the other candidate strategy with probability equal to the difference between the maximum possible payoff and his own payoff, divided by the maximum possible payoff minus the minimum possible payoff. (The other candidate's payoff is ignored.)</p>
<blockquote class="blockquote ">
<footer class="blockquote-footer">If
<parameter>complete-matching?</parameter> is
<value>On</value>, the mean dynamics for large populations of the
<value>imitative</value>
<value>linear-dissatisfaction</value> protocol (sometimes called <i>imitation driven by dissatisfaction</i>) is the replicator dynamics up to a speed factor (see Weibull (1995, section 4.4.1, pp. 153-5) or Sandholm (2010, example 5.4.3)).</footer>
</blockquote>
</div>
<div class="tab-pane" id="linear-attraction">
<p>In
<value>linear-attraction</value>, the agent always considers exactly two candidates (one corresponding to his own strategy or to himself, and another one), i.e., the value of
<parameter>n-of-candidates</parameter> is automatically set to 2.</p>
<p>The revising agent will adopt the other candidate strategy with probability equal to the difference between the other candidate's payoff and the minimum possible payoff, divided by the maximum possible payoff minus the minimum possible payoff. (The revising agent's payoff is ignored.)</p>
<blockquote class="blockquote ">
<footer class="blockquote-footer">If
<parameter>complete-matching?</parameter> is
<value>On</value>, the mean dynamics for large populations of the
<value>imitative</value>
<value>linear-attraction</value> protocol (sometimes called <i>imitation of success</i>) is the replicator dynamics up to a speed factor (see Weibull (1995, section 4.4.3, pp. 158-60) or Sandholm (2010, example 5.4.4)).</footer>
</blockquote>
</div>
</div>
</div>
</div>
<div id="par-files" class="subsection">
<h2>How to save and load parameter files</h2>
</div>
<div class="row well">
<div class="col-xs-12">
<p>Clicking on the button labeled
<button>save parameters to file</button>, a window pops up to allow the user to save all parameter values in a .csv file.
</p>
<p>Clicking on the button labeled
<button>load parameters from file</button>, a window pops up to allow the user to load a parameter file in the same format as it is saved by <i>Abed-1pop</i>.
</p>
</div>
</div>
<div id="usage" class="section">
<h1>How to use it</h1>
<br>
</div>
<br>
<h2 id="running" style="border-bottom: 1px solid black;padding-top: 60px;margin-top: -60px;" class="subsection">Running the model</h2>
<div class="row">
<div class="col-xs-12">
<p>Once the model is parameterized (see <a href="#parameters" class="scroll-link">Parameters section</a>), click on the button labeled
<button>setup</button> to initialize everything. Then, click on
<button>go</button> to run the model indefinitely (until you click on
<button>go</button> again). A click on
<button>go once</button> runs the model one tick only.
</p>
<div class="alert alert-danger">
<p>The value of all parameters can be changed at runtime with immediate effect on the model</p>
</div>
</div>
</div>
<h2 id="plots" style="border-bottom: 1px solid black;padding-top: 60px;margin-top: -60px;" class="subsection">Plots and monitors</h2>
<div class="row">
<div class="col-xs-12">
<p>All plots in <i>Abed-1pop</i> show units of time in the horizontal axis. These are called seconds and milliseconds for simplicity, but they could be called in any other way. One second is defined as the number of ticks over which the expected number of revisions equals the total number of agents. This number of ticks per second is called
<button class="monitor">ticks-per-second</button> and is shown in a monitor. The other monitor in <i>Abed-1pop</i> shows the
<button class="monitor">ticks</button> that have been executed. Plots are updated every
<parameter>plot-every-?-secs</parameter> seconds.</p>
<p>There are two plots to show the strategy distribution in the population of agents as ticks go by, like the one below:</p>
<p><img src="./assets/img/complete-shares.png" alt="complete-shares" class="img-center img-responsive"></p>
<p> and two other plots to show the expected payoff of each strategy as ticks go by, like the one below:</p>
<p><img src="./assets/img/complete-payoffs.png" alt="complete-payoffs" class="img-center img-responsive"></p>
<p>Each of the two types of plots described above comes in two different flavors: one that shows the data from the beginning of the simulation (labeled <i>complete history</i> and active if
<parameter>show-complete-history?</parameter> is
<value>On</value>) and one that shows only the
<parameter>duration-of-recent</parameter> last seconds in the simulation (labeled <i>recent history</i> and active if
<parameter>show-recent-history?</parameter> is
<value>On</value>).
</p>
</div>
</div>
<div id="license" class="section">
<h1>License</h1>
<br>
<p><strong>Abed-1pop</strong> (<strong>A</strong>gent-<strong>B</strong>ased <strong>E</strong>volutionary <strong>D</strong>ynamics in <strong>1 pop</strong>ulation) is a modeling framework designed to simulate the evolution of a population of agents who play a symmetric 2-player game and, from time to time, are given the opportunity to revise their strategy.</p>
<p>Copyright (C) 2017 <a target="_blank" href="http://luis.izqui.org">Luis R. Izquierdo</a>, <a target="_blank" href="http://segis.izqui.org">Segismundo S. Izquierdo</a> & <a target="_blank" href="http://www.ssc.wisc.edu/~whs/">Bill Sandholm</a>
</p>
<p>This program is free software; you can redistribute it and/or modify it under the terms of the <a target="_blank" href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a> as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the <a target="_blank" href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a> for more details.</p>
<p>You can download a copy of the <a target="_blank" href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a> by clicking <a target="_blank" href="./LICENSE">here</a>; you can also get a printed copy writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</p>
<p>Contact information:
<br>Luis R. Izquierdo
<br> University of Burgos, Spain.
<br> e-mail: <a href="mailto:lrizquierdo@ubu.es">lrizquierdo@ubu.es</a>
</p>
</div>
<div id="extending" class="section">
<h1>Extending the model</h1>
<br>
<p>You are most welcome to extend the model as you please, either privately or by creating a branch in <a target="_blank" href="https://github.com/luis-r-izquierdo/abed-1pop">our Github repository</a>. If you’d like to see any specific feature implemented but you don’t know how to go about it, do feel free to email us and we’ll do our best to make it happen.</p>
</div>
<div id="acknowledgements" class="section">
<h1>Acknowledgements</h1>
<br>
<p>Financial support from the U.S. National Science Foundation, the U.S. Army Research Office, the Spanish Ministry of Economy and Competitiveness, and the Spanish Ministry of Science and Innovation is gratefully acknowledged.</p>
</div>
<div id="references" class="section">
<h1>References</h1>
<br>
<p style="text-align:left">Sandholm, W. H. (2010). <i>Population Games and Evolutionary Dynamics</i>. MIT Press, Cambridge.</p>
<p style="text-align:left">Weibull, J. W. (1995). <i>Evolutionary Game Theory</i>. MIT Press, Cambridge.</p>
</div>
<div id="howtocite" class="section">
<h1>How to cite</h1>
<br>
<p>Izquierdo, L.R., Izquierdo, S.S. & Sandholm, W.H. (2019). An Introduction to ABED: Agent-Based Simulation of Evolutionary Game Dynamics.
<i>Games and Economic Behavior</i>, 118, pp. 434-462.</p>
<a target="_blank" href="https://doi.org/10.1016/j.geb.2019.09.014"><span>[Download at publishers's site]</span></a> | <a target="_blank" href="http://luis.izqui.org/papers/abed.pdf"><span>[Working Paper]</span></a> | <a target="_blank" href="http://luis.izqui.org/papers/online-appendix-abed.pdf"><span>[Online appendix]</span></a> | <a target="_blank" href="https://prezi.com/view/Ifl2dgvONoqPHdWlDI3q/"><span>[Presentation]</span></a>
<br>
</div>
<div class="col-xs-12">
<hr>
<footer>
<p class="text-center text-muted"> © Luis R. Izquierdo, Segismundo S. Izquierdo & Bill Sandholm 2017 <i class="fa fa-users"></i> </p>
</footer>
</div>
</div>
<div class="col-sm-2">
<div class="sidebar-nav hidden-xs">