README for SimBuilder sample simulations.

SimBuilder is distributed with seven sample simulations. Five of these are
taken from Skyrms and Pemantle, "A Dynamic Model of Social Network
Formation." Proceedings of the National Academy of Sciences, August 1,
2000, vol. 97, no. 16., pp. 9340 - 9346. The remaining two are
implementations of two common models.

1. uniform_reinforcement_past.sbp

This is a model of Skyrms and Pemantles' Friends I, Friends II and
Discounting the Past simulations.

The basic idea here is that every iteration of the simulation each
agent chooses another agent at random to form a link with. The choice
of whom to form a link with is determined by a vector of weights each
agent has assigned to all the other agents. Each element of the vector
corresponds the weight of another agent. The probabilty that agent i
will form a link with j is the current weight of j divided by the sum
of the entire vector of weights. When a link is formed that agent gets
a reinforcement of 1, that is, a value of one is added to the current
weight of that agent.

So, each iteration for each agent the current probabilities are
calculated from the current weights as described above. On the basis
of these probabilities each agent i forms a link with some other
agent j. Then the weight of agent j in agent i's vector of weights is
increased by one.

The simulation can also be run with symmetrical reinforcement. In this
case, when agent i forms a link with some other agent j. Then in
addition to the weight of agent j in agent i's vector of weights being
increased by one, the weight of agent i in agent j's vector of weights
is also increased by one. To turn on symmetrical reinforcement, check
the symmetrical box once you've compiled and run the simulation.

The simulation can also be run with past weights discounted by a user
specified value. In this case, the weights from the previous iteration
are multiplied by some discounting factor before adding the current
undiscounted payoffs. To turn this feature on, enter a value between 0
and 1 in the pastDiscount box once you've compiled and run the
simulation.

In addition, the simulation will dump a matrix containing all the
agents weight vectors to the console whenever the simulation is
paused. To turn this off uncheck the dump box, once you've compiled
and run the simulation.


2. uniform_reinforcement_past_linker.sbp

This is the same as above, but demonstrates how to write the same
simulation using the NodeLinker component.

This does not contain the dump or symmetrical features, although they
could easily be added.


3. uniform_reinforcement_past_noise_linker.sbp

This is the same model as 2 above, but adds noise to the probability
rule. The probability of i linking with j is now some fixed positive
number e / (n - 1), plus (1 - e) times what it was in sample 1 and 2,
where n is the number of agents.

This simulation also uses the NodeLinker component, and is a good
example of the use of it.

4. stag_hunt.sbp

Stag hunt indexes the reinforcement to the following payoff matix:

            | Hunt Stag | Hunt Rabbit
------------+-----------+-------------
Hunt Stag   | (1, 1)    | (0, .75)
------------+-----------+-------------
Hunt Rabbit | (.75, 0)  | (.75, .75)
------------+-----------+-------------

Half the agents begin as stag hunters and half as rabbit hunters. If a
stag hunter i forms a link with a stag hunter j then each is updated
in the other's weight vector by 1. If rabbit hunter forms a link with a
stag hunter then the stag hunter's weight in the rabbit hunter's
vector is increased by .75 and the rabbit hunter's weight in the stag
hunter's vector is increased by 0. And so on for the other cells in
the payoff matrix.

You can also discount the past in this simulation.

5. stag_hunt_with_switch.sbp

This is identical to stag hunt, but after all the agent's have played
the game and formed new links. Each agent is given the opportunity to
switch to the strategy that yielded the best payoff. An agent will
switch according to a user specified probability.

This also implements discounting the past.

Note that this is probably not be how Skyrms and Pemantle implemented
switching.

6. schelling.sbp.

This is an implementation of Schelling's segregation
Model as described in Models of Segregation (in Strategic Theory and
Its Applications). Thomas C. Schelling.  The American Economic Review,
Vol. 59, No. 2, Papers and Proceedings of the Eighty-first Annual
Meeting of the American Economic Association. (May, 1969),
pp. 488-493. The basic idea here is that there are types of agents and
each agent has a tolerance level that determines the percentage of its neighbors
that can be of the other type before the agent moves to a new more tolerable
location.

7. prisonners_dilemma.sbp

This is a basic implementation of Iterated Prisoner's dilemma. The implementation
is based on Cohen, Michael D., Riolo, Rick L. and Axelrod, Robert. "The
Emergence of Social Organization in the Prisoner's Dilemma: How Context-
Preservation and other Factors Promote Cooperation." Note that this SimBuilder
implementation does not completely implement the various models described in
the paper.  Rather the SimBuilder implementation works as follow:

A run begins by creating the agents and assigning them a strategy to play.
The four strategies are always cooperate, always defect, tit-for-tat, and
anti-tit-for-tat. The percentage of agents playing each property is
determined by model parameters. The agents are then distributed randomly
across a grid. Each iteration of the simulation, all the agents are initialized,
setting their payoff and number times played fields to 0, and setting their
current strategy to the new strategy chosen in the adapt action mentioned
below. Then each agent will play each of its Von Neumann neighbors 4 times.
After all the agents have played each agent is give a chance to adapt its
strategy by polling its neighbors to see which strategy resulted in the best
payoff. The agent then adopts that strategy to play in the next round.




