Table of Contents
Programming for Social ScientistsLecture 4
Exercise 1b
Exercise 1c
Exercise 1c (cont'd)
Exercise 2: Player.m
Exercise 2: Revolver.m
Prisoner's Dilemma Game
Iterated Prisoner's Dilemma
One-Step Memory Strategies
The Four Strategies(cf. Cohen et al. p. 8)
A four-iterations PD
all-D meets TFT
Moves and Total Payoffs for all4 x 4 Strategy Combinations
simpleIPD: File structure
simpleIPD: main.m
The ModelSwarm
simpleIPD: ModelSwarm.h
Creating a Swarm
Step I: Initializing the ModelSwarm
Details on createBegin method
Memory zones
Where did that zone come from?
Step II: Building the agents
Details on the buildObjects phase
Why createBegin vs. create?
simpleIPD: ModelSwarm.m (cont'd)
simpleIPD: Player.h
simpleIPD: Player.m
Step III: Building schedules
Schedules
ActionGroups
Implementation
Step IV: Activating the Swarm
Activation of schedule(s)
Previous example as a for loop
|
Author: Lars-Erik Cederman
Email: cederman@ucla.edu
Download presentation source
|