RePast
v. 2.0

uchicago.src.sim.engine
Interface SimModel

All Superinterfaces:
DescriptorContainer, SimEventProducer
All Known Implementing Classes:
SimModelImpl

public interface SimModel
extends SimEventProducer, DescriptorContainer

Interface for all RePast models.


Method Summary
 void begin()
          Begins a simulation run.
 void clearMediaProducers()
          Clears the vector of displaySurface
 void clearPropertyListeners()
          Clears the list of property listeners.
 void generateNewSeed()
          Generates a new random number seed and makes it the default.
 BaseController getController()
          Gets the BaseController associated with this model.
 String[] getInitParam()
          Gets the names of the initial model parameters to set.
 Vector getMediaProducers()
          Gets a Vector of the MediaProducers registered with this model.
 ModelManipulator getModelManipulator()
          Gets the ModelManipulator.
 String getName()
          Gets the name of the model/simulation.
 Hashtable getParameterDescriptors()
          Gets a hashtable of ParameterDescriptors where key is parameter name, and value is the ParameterDescriptor.
 String getPropertiesValues()
          Gets a list of the simulation properties and values.
 long getRngSeed()
          Gets the default random number seed.
 Schedule getSchedule()
          Gets the Schedule created by the model.
 long getTickCount()
          Gets the current tick count for the execution of this model
 double getTickCountDouble()
          Gets the current tick count for the execution of this model
 void setController(BaseController controller)
          Sets the controller for this simulation model
 void setRngSeed(long seed)
          Sets the random number seed.
 void setup()
          Prepares a model for a new run, typically by deallocating objects or setting them to some reasonable default.
 
Methods inherited from interface uchicago.src.sim.engine.SimEventProducer
addSimEventListener, fireSimEvent, removeSimEventListener
 

Method Detail

getInitParam

public String[] getInitParam()
Gets the names of the initial model parameters to set. These names must have get and set methods supplied by the model. For example, for the parameter maxAge, the model must have getMaxAge and setMaxAge methods.

Returns:
a String[] of the initial parameter names

begin

public void begin()
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()
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()
Gets the Schedule created by the model.

Returns:
the schedule created by the model

getName

public String getName()
Gets the name of the model/simulation.

Returns:
the name of the model/simulation

getPropertiesValues

public String getPropertiesValues()
Gets a list of the simulation properties and values. For example,
 MaxVision: 3
 MaxMetabolism: 4
 NumAgents: 52
 

Returns:
the String of properties and values

setRngSeed

public void setRngSeed(long seed)
Sets the random number seed. This sets the seed for the generator for random number distributions in the Random class.

Parameters:
seed - the random number seed.
See Also:
Random

getRngSeed

public long getRngSeed()
Gets the default random number seed.


generateNewSeed

public void generateNewSeed()
Generates a new random number seed and makes it the default.


getTickCount

public long getTickCount()
Gets the current tick count for the execution of this model

Returns:
the current tick count

getTickCountDouble

public double getTickCountDouble()
Gets the current tick count for the execution of this model

Returns:
the current tick count

setController

public void setController(BaseController controller)
Sets the controller for this simulation model

Parameters:
controller - the controller to associate with this model

getController

public BaseController getController()
Gets the BaseController associated with this model.


getModelManipulator

public ModelManipulator getModelManipulator()
Gets the ModelManipulator.


getMediaProducers

public Vector getMediaProducers()
Gets a Vector of the MediaProducers registered with this model.


clearMediaProducers

public void clearMediaProducers()
Clears the vector of displaySurface


clearPropertyListeners

public void clearPropertyListeners()
Clears the list of property listeners.


getParameterDescriptors

public Hashtable getParameterDescriptors()
Gets a hashtable of ParameterDescriptors where key is parameter name, and value is the ParameterDescriptor.

Specified by:
getParameterDescriptors in interface DescriptorContainer

RePast
v. 2.0

Bug reports and feature requests to RePast