UM IPDm0 This is an implementation of *versions of* two PD models: 1) The Nowak and May model as described in: Evolutionary Games and Spatial Chaos. Martin A. Nowak and Robert M. May. Nature, 359, pp826-829 (29 Oct 1992). 2) The Epstein model described in: Zones of Cooperation in Demographic Prisoner's Dilemma. Joshua M. Epstein Santa Fe Institute Working Paper SFI-97-12-094 (1997). In both models, agents are Cooperators (C) or Defectors (D). You can set the fraction of C at start from 0 to 1. The strategies are distributed randomly. Agents play one round when they meet. Thus its not an ``iterated'' prisoner's dilemma, except across generations. Payoffs are C-C 1,1 C-D 0,b D-C b,0 D-D 0,0 b is the parameterized tempatation payoff. It can be changed ``on the fly'' via the GUI. Each ``generation'' agents play some or all of their neighbor agents, and both accumulate scores from those plays. Agents then either change strategies (Nowak/May) or give birth and die (Epstein), based on how well they did. Details of the two models are given below. Agents are displayed on a 2D raster. There are two color schemes, controlled by changing the value of the ColorScheme parameter: ColorScheme ----------- 0 two colors, C = Blue, D = Red 1 A 4-color scheme: Strategy(t) Strategy(t=1) Blue C C Red D D Yellow C D Green D C Mouse clicks on agents in the raster display produce these effects: MB1 (left): toggle type MB3 (right): probe that agent, so you can watch its instance variables (internal state) change from step to step. Parameters are settable on the run command, or via the gui, or through an input file (the format is the same as that in the report file that is produced with each run). These parameters can be set only at the start of a run, before agents are created: Parameter Relevant Model --------- -------------- worldSize both numBugs both fractionC both minVision, maxVision Epstein These can be set at any time: ColorScheme both b both birthTh Epstein offspringShare Epstein mRate Epstein metabEachStep Epstein maxAge Epstein mutRate Epstein sync both The function of all these parameters are explained below. Examples (this assumes the model is in your working directory): To run with worldSize=30, b=2.1, and all other parameters at defaults: ./m0 -DworldSize=30 -Db=2.1 After you run it, there will be a file report which contains the initial parameter values, any changes you made, and lines of output data. You can have it write to files of different names, e.g. ./m0 -DRFN=output -DRN=00 will write to a file output.00 (The RNF is report file name, the RN is report file name suffix). To get a list of all run-time settable parameters and their aliases: ./m0 -Dh If you do not have a copy of this model in your directory space, you can run our standard copy by replacing "./m0" with this: /users/rlr/SwarmStuff/CSCS-Demos/IPDm0/m0 including any of the parameters described in the examples here. ======================================================================= The Nowak and May model. ------------------------ This model is executed when the world is started with all sites occupied with bugs, i.e., when numbugs == WorldSize * WorldSize. In this case the relevant parameters are: - worldSize size of each side of the square world - numbugs initial number of agents - fractionC starting fraction of cooperators - b the temptation payoff - sync Synchronous updating 1 (1, the default) or off (0). sync=1 The original Nowak/May mechanism. First each agent gets one chance to play all its neighbors and accumulate scoreseach generation. Then each agent is allowed to update its strategy based on those scores. sync=0 Asynchronous play and updating, as described in Huberman and Glance, PNAS USA, v90, pp7716-7718 (August 1993). Each generation numBugs agents are selected to play and be updated; they are selected with replacement, which means in any given generation some agents might be picked 0, 1, 2 or more times, but the expectation is to be selected once per generation. When an agent is picked, it plays its neighbors, then immediately decides based on accumulated scores whether or not it wants to update its strategy. - ColorScheme control color of agent display (see notes above) Notes: 0. ** How are and how should scores be accumulated?? 1. It would be nice to add information delays as hinted at by Huberman and Glance. 2. For Nowak and May's response to Huberman and Glance, see Nowak, Bonhoeffer and May, Proc NAS (USA) v91 pp4877-4881, May 1994. ======================================================================= The Epstein model. ------------------ This version is run by not filling the world with agents when it is started, i.e., to set numBugs < worldSz**2. In this case, each ``generation'' each agent does the following: - it looks within its vision range (a square region around it) for any open sites, and of those found, it moves to a random one. - it looks for agents in its 8 moore-neighborhood, and from any there, it picks *one* at random to play one PD game. Both agents add their payoffs from that game to their cummulative wealth. if metabEachStep == 0, and the agent plays another, then each decrements its wealth by mRate. if metabEachStep == 1, then the agent being moved/updated decrements its wealth whether it played another or not. - the agent then checks to see if its wealth > birthTh (birth threshold), and if it is, and if there is an open site in its vision range, it creates an offspring. The parent wealth is split giving wealth * offspringShare to the offspring, the parent keeping the rest. The offspring is a clone if muRate is 0, otherwise it is flipped with probability == mutRate. - if the agent's wealth < 0, or if the agent's age > maxAge, the agent is marked to die, and is killed off *at the end of the generation*. - the agent's age is incremented by one. There is a metabolic rate, mRate, which is an amount that is decremented from an agent's wealth each time it interacts with another agent (if metabEachStep=0), or each time they are active (if metabEachStep=1). Other relevant parameters: - maxVision, minVision initial agents are created with vision uniformly distributed in this range. Here is a typical way to start it: ./m0 -DX=30 -DN=90 -DfractionC=0.2 -DmRate=0.3 -Db=2.0 -DmaxAge=200 Notes: - age could be incremented for all agents once each generation, synchronously. - we could check for dead agents and not play them. ======================================================================= NOTES: 0. It might be nice to have ``named'' starting conditions, e.g., ``oneDcenter''. (Currently one must use probes to do this.) 1. This could use some checking and experiments, to make sure it does what it is supposed to do! ======================================================================= Updates: Feb, 1997; July, 1999; July 2000;