Class RunState
- java.lang.Object
-
- repast.simphony.engine.environment.RunState
-
public class RunState extends Object
A class that contains information about the current (or upcoming) simulation run.
-
-
Field Summary
Fields Modifier and Type Field Description static Context
safeMasterContext
static RunState
staticInstance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToRegistry(Object key, Object value)
Adds an item to the general registry.ControllerRegistry
getControllerRegistry()
Retrieves theControllerRegistry
used to setup and teardown the simulation.Object
getFromRegistry(Object key)
Gets the item identified by the specified key from the general registry.GUIRegistry
getGUIRegistry()
Retrieves the GUI registrystatic RunState
getInstance()
Context
getMasterContext()
Retrieves the master context for the simulation.RandomRegistry
getRandomRegistry()
RunInfo
getRunInfo()
Retrieves the run info.static Context
getSafeMasterContext()
ScheduleRegistry
getScheduleRegistry()
Retrieves the schedule registry.static RunState
init()
static RunState
init(RunInfo runInfo, ScheduleRegistry scheduleRegistry, GUIRegistry guiRegistry)
static RunState
initDistributed()
Object
removeFromRegistry(Object key)
Removes the item identified by the specified key from the general registry.void
setControllerRegistry(ControllerRegistry controllerRegistry)
Sets theControllerRegistry
used to setup and teardown the simulation.void
setGUIRegistry(GUIRegistry guiRegistry)
Sets the GUI registryvoid
setMasterContext(Context masterContext)
Sets the master context for the simulation.void
setRandomRegistry(RandomRegistry registry)
void
setRunInfo(RunInfo runInfo)
Sets the run info.static void
setSafeMasterContext(Context safeMasterContext)
void
setScheduleRegistry(ScheduleRegistry scheduleRegistry)
Sets the schedule registry
-
-
-
Method Detail
-
setSafeMasterContext
public static void setSafeMasterContext(Context safeMasterContext)
-
init
public static RunState init()
-
initDistributed
public static RunState initDistributed()
-
init
public static RunState init(RunInfo runInfo, ScheduleRegistry scheduleRegistry, GUIRegistry guiRegistry)
-
getInstance
public static RunState getInstance()
-
getRunInfo
public RunInfo getRunInfo()
Retrieves the run info.- Returns:
- the run info
-
setRunInfo
public void setRunInfo(RunInfo runInfo)
Sets the run info.- Parameters:
runInfo
- the run info
-
getScheduleRegistry
public ScheduleRegistry getScheduleRegistry()
Retrieves the schedule registry.- Returns:
- the schedule registry
-
setScheduleRegistry
public void setScheduleRegistry(ScheduleRegistry scheduleRegistry)
Sets the schedule registry- Parameters:
scheduleRegistry
- the schedule registry
-
getGUIRegistry
public GUIRegistry getGUIRegistry()
Retrieves the GUI registry- Returns:
- the GUI registry
-
setGUIRegistry
public void setGUIRegistry(GUIRegistry guiRegistry)
Sets the GUI registry- Parameters:
guiRegistry
- the gui registry
-
addToRegistry
public void addToRegistry(Object key, Object value)
Adds an item to the general registry.- Parameters:
key
- the items idvalue
- the item itself
-
removeFromRegistry
public Object removeFromRegistry(Object key)
Removes the item identified by the specified key from the general registry.- Parameters:
key
- the items id- Returns:
- the removed item.
-
getFromRegistry
public Object getFromRegistry(Object key)
Gets the item identified by the specified key from the general registry.- Parameters:
key
- the items id- Returns:
- the item or null if the item is not found.
-
setMasterContext
public void setMasterContext(Context masterContext)
Sets the master context for the simulation.- Parameters:
masterContext
- the simulation's master context
-
getMasterContext
public Context getMasterContext()
Retrieves the master context for the simulation.- Returns:
- the simulation's master context
-
getSafeMasterContext
public static Context getSafeMasterContext()
-
setControllerRegistry
public void setControllerRegistry(ControllerRegistry controllerRegistry)
Sets theControllerRegistry
used to setup and teardown the simulation.- Parameters:
controllerRegistry
- the run'sControllerRegistry
-
getControllerRegistry
public ControllerRegistry getControllerRegistry()
Retrieves theControllerRegistry
used to setup and teardown the simulation.- Returns:
- the run's
ControllerRegistry
-
getRandomRegistry
public RandomRegistry getRandomRegistry()
-
setRandomRegistry
public void setRandomRegistry(RandomRegistry registry)
-
-