uchicago.src.repastdemos.enn
Class EnnModel
java.lang.Object
uchicago.src.sim.engine.SimModelImpl
uchicago.src.repastdemos.enn.EnnBase
uchicago.src.repastdemos.enn.EnnModel
- All Implemented Interfaces:
- DescriptorContainer, SimEventProducer, SimModel
public class EnnModel
- extends EnnBase
A partial implementation of Randal Picker's Endogenous Neighborhood game as
described in his as yet unpublished "Endogenous Neighborhoods and Norms."
This simulation extends prior work by Randal Picker. See "Simple Games in a
Complex World: A Generative Approach to the Adoption of Norms", 64 University
of Chicago Law Review 1225 (1997). Thanks to Randal Picker for allowing us to
include this with Repast.
Here agent's play a coordination game with their neighbors and receive a
payoff. After all agents have have played the game, then each agents
determines whether the current location and strategy meet their aspiration,
changing strategies and moving if necesary. As described in the paper,
satisfied agents can play a strategy of "strategy upgrade" or "pure
aspiration". Here only strategy upgrade is implemented. Playing this strategy
means that a content agent finds the best average strategy of all its
neighbors and plays this the next turn. Unsatisfied agents can have a
strategy of either move and change or change first. A strategy of move and
changes means that an agent moves a random distance in a random direction and
then changes its stratgey to the best average strategy of all its neighbors.
Change first means that an agent changes its strategy and then if still
unsatisfied, changes to a move and change strategy the next turn.
These values can be changed as initial parameters before a run
.
PURE_ASPIRATION = 0
STRATEGY_UPGRADE = 1
CHANGE_FIRST = 2
MOVE_AND_CHANGE = 3
See the playGame method of EnnAgent for the details of the strategies.
See SugarModel.java for more on the general structure of a simulation model
file.
- Version:
- $Revision: 1.1 $ $Date: 2005/08/12 20:04:51 $
- Author:
- Nick Collier and Randal Picker
| Fields inherited from class uchicago.src.repastdemos.enn.EnnBase |
agentList, aspiration, bValue, DO_LOAD_GUI, DONT_LOAD_GUI, gridDensity, happyPlay, leftPercent, loadGui, recorder, schedule, shuffle, space, unhappyPlay, WORLD_X_SIZE, WORLD_Y_SIZE |
|
Method Summary |
void |
begin()
Begins a simulation run. |
java.lang.String |
getName()
Gets the name of the model/simulation. |
Schedule |
getSchedule()
Gets the Schedule created by the model. |
protected void |
initDataRecorder()
|
static void |
main(java.lang.String[] args)
|
void |
setup()
Prepares a model for a new run, typically by deallocating objects or
setting them to some reasonable default. |
| Methods inherited from class uchicago.src.repastdemos.enn.EnnBase |
buildModel, computeOAC, computeOSWA, computeRave, getAspiration, getBValue, getDoShuffle, getGridDensity, getHappyPlay, getInitParam, getLoadGui, getPercentLeft, getUnhappyPlay, setAspiration, setBValue, setDoShuffle, setGridDensity, setHappyPlay, setLoadGui, setPercentLeft, setUnhappyPlay |
| Methods inherited from class uchicago.src.sim.engine.SimModelImpl |
addPropertyListener, addSimEventListener, clearMediaProducers, clearPropertyListeners, fireBooleanPropertyEvent, fireEndSim, fireNumericPropertyEvent, fireObjectPropertyEvent, firePauseSim, fireSimEvent, fireStopSim, fireStringPropertyEvent, generateNewSeed, getController, getMediaProducers, getModelManipulator, getParameterDescriptors, getPropertiesValues, getRngSeed, getTickCount, pause, registerDisplaySurface, registerMediaProducer, removePropertyListener, removeSimEventListener, setController, setRngSeed, stop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EnnModel
public EnnModel()
initDataRecorder
protected void initDataRecorder()
- Specified by:
initDataRecorder in class EnnBase
begin
public void begin()
- Description copied from interface:
SimModel
- Begins a simulation run. All initialization, building the model, diplay,
etc. should take place here. This method is called whenever the start
button (or the step button if the run has not yet begun) is clicked. If
running in batch mode this is called to kick off a new simulation run.
setup
public void setup()
- Description copied from interface:
SimModel
- Prepares a model for a new run, typically by deallocating objects or
setting them to some reasonable default. Called whenever the setup button
is clicked or if operating in batch mode whenever a single run has ended in
preparation for the next. Also called when the model is first loaded.
getSchedule
public Schedule getSchedule()
- Description copied from interface:
SimModel
- Gets the Schedule created by the model.
- Specified by:
getSchedule in interface SimModel- Overrides:
getSchedule in class EnnBase
- Returns:
- the schedule created by the model
getName
public java.lang.String getName()
- Description copied from interface:
SimModel
- Gets the name of the model/simulation.
- Specified by:
getName in interface SimModel- Overrides:
getName in class EnnBase
- Returns:
- the name of the model/simulation
main
public static void main(java.lang.String[] args)