Parameters class documentation

Authors

Generated by pauljohn

Contents -

  1. Software documentation for the Parameters class
  2. Parameters functions

Software documentation for the Parameters class

Parameters : SwarmObject

Declared in:
Parameters.h

Parameters is an "overarching" object that has parameters that are needed by many classes in the simulation. It works together with MyArguments to process command line parameters that are given at start time. In GUI mode, it creates a probe display that allows the user to enter parameter values before the simulation begins. Command line argument processing opens the possibility of running batches of simulations that automatically change parameter values with each experiment. This can be done by using Swarm with an auxiliary program called Drone.

Parameters has all of the same instance variables as MyArguments , plus a few more. It exists as a separate class only because MyArguments, the command line argument processor, carries along with it some baggage that makes it difficult to serialize. So I opt to just copy parameters out of the default arguments object and keep them here in Parameters because I can control its features.

The variable "numNeighborhoods" is the number of homeGrids. The number of workPlaces is set by the numWorkplaces parameter. The dimensions of each homeGrids are (worldXSize by worldYSize) and the dimensions of workGrid are (workXSize by workYSize).

If variableCellSize is 0, then the number of citizens in each cell is set at the parameter pplPerCell. If variableCellSize is 1, then the number of citizens in a given cell is a draw from Uniform[0, 2*pplPerCell].

Parochialism is the probability that someone looks for a discussant in their own cell rather than looking to a neighbor. This affects Axelrod and Coleman selection models.

wrapAround and oneAtATime control the nature of the basic simulation model. If wrapAround is 1, agents are situated in a toroidal world in which none are on the "edge." If wraparound is 0, as in Axelrod's original model, citizens on the edge have fewer possible discussants. If oneAtATime is 1, Axelrod's approach is followed of randomly selecting one agent to act at each step. When oneAtATime is 0, we have a Knight's tour of all agents before any agent repeats its step. Unless randomizeCitizenUpdateOrder is 0, the tour of agents will traverse a randomly mixed list of agents each time through.

Daylength determines the number of Swarm time steps that occur during the "day" of an agent. A "day" is broken into steps, during which the agent can move from one neighborhood to another or initiate an interaction.


Instance Variables

Method summary

createBegin: 

+ (id) createBegin: (id)aZone;
This is a designated initialiser for the class.

Begin the creation of the Parameter object


getCharDate 

- (char*) getCharDate;

Returns a sanitized character string for today's date


getConsistentAdjustment 

- (BOOL) getConsistentAdjustment;

If it is the case that two agents are allowed to change their opinions, then should we require that their changes are consistent? Should we rule out the possibility that each might copy the other and they would part still disagreeing? This returns an indicator if the consistentAdjustment flag is yes or no


getOneAtATime 

- (BOOL) getOneAtATime;

Return the Boolean variable oneAtATime


getOnlyOneAdjusts 

- (BOOL) getOnlyOneAdjusts;

Is it possible that both agents who interact might change their minds. If so, then onlyOneAdjusts should be NO. THe logic that determins which (or both) changes has to be set within the Citizen class (or its descendants)


getOnlySelfAdjusts 

- (BOOL) getOnlySelfAdjusts;

When an agent initiates an interaction, is that agent the only one that can change its opinion after?


getPplPerCellArg 

- (int) getPplPerCellArg;

Returns the number of agents per cell in the neighborhood


getRandomOrder 

- (BOOL) getRandomOrder;

Return the Boolean variable randomOrder


getRunArg 

- (int) getRunArg;

Returns the run number


getSeedArg 

- (int) getSeedArg;

Returns the value of the random seed, either from the command line or graphical interface


getVariableCellSize 

- (BOOL) getVariableCellSize;

Returns the variable indiciating if the number of agents per cell is variable or not


getWrapAround 

- (BOOL) getWrapAround;

Indicates whether the grid is seen as a wrap around torus or not.


init 

- (id) init;

Description forthcoming.


sayHello 

- (id) sayHello;

Description forthcoming.


setSeed: 

- (id) setSeed: (int)x;

Sets the value of the random seed.


toggleOneAtATime 

- (BOOL) toggleOneAtATime;

Toggles the way the citizenList is processed at each step. If the list is processed oneAtATime, then it is the Axelrod method. That means one makes N draws (with replacement) from the collection and tells each agent to step. Otherwise, a tour through the whole list is made before beginning again.


toggleRandomOrder 

- (BOOL) toggleRandomOrder;

In case the oneAtATime method is not used, this assures that the list of agents is processed in random order at the beginning of each day


toggleVariableCellSize 

- (BOOL) toggleVariableCellSize;

If variableCellSize = NO, then all home neighborhoods have the same number of cells. If YES, then the agents are distributed unevenly over the neighborhood.




Instance Variables for Parameters Class

charDate

@protected char* charDate;

Description forthcoming.


filename

@protected char* filename;

Description forthcoming.





Parameters functions

getDouble

double getDouble(id obj, const char* ivarName);

Description forthcoming.


getInt

int getInt(id obj, const char* ivarName);

Description forthcoming.


makeProbe

id makeProbe(id obj, const char* ivarName);

Description forthcoming.