Package repast.simphony.scenario
Class Scenario
java.lang.Object
repast.simphony.scenario.Scenario
- All Implemented Interfaces:
ScenarioChangedListener
- Direct Known Subclasses:
BatchScenario
Encapsulates a repast simphony scenario.
- Author:
- Nick Collier
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContextData
static final ControllerAction
protected boolean
protected File
protected List<ControllerAction>
protected UserPathData
protected String
protected File
protected List<ParameterSetter>
protected ControllerRegistry
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the specified ControllerAction to the master context.void
addParameterSetter
(ParameterSetter paramInit) Gets all the user added master controller actions.Instantiates and returns the first ModelInitializer found in the user's model classpath.Gets the scenario directory.boolean
isDirty()
Gets whether or not this scenario is dirty, i.e.void
Removes the specified ControllerAction to the master context.void
removeParameterSetter
(ParameterSetter paramSetter) void
Called whenever the Scenario has changed.void
setControllerRegistry
(ControllerRegistry registry) void
setDirty
(boolean dirty) Set the dirty flag on this scenario.void
setModelInitName
(String modelInitName) void
setModelPluginPath
(File modelPluginPath) void
setScenarioDirectory
(File dir) Sets the scenario directory.
-
Field Details
-
DEFAULT_MASTER_PARENT
-
SCENARIO_FILE_NAME
- See Also:
-
file
-
context
-
modelData
-
paramSweepers
-
masterActions
-
registry
-
modelInitName
-
modelPluginPath
-
dirty
protected boolean dirty
-
-
Constructor Details
-
Scenario
-
-
Method Details
-
getContext
-
getModelData
-
getModelInitializer
public ModelInitializer getModelInitializer() throws IOException, ClassNotFoundException, IllegalAccessException, InstantiationExceptionInstantiates and returns the first ModelInitializer found in the user's model classpath. If a ModelInitializer is not found, this will return an empty one.- Returns:
- the first ModelInitializer found in the user's model classpath. If a ModelInitializer is not found, this will return an empty one.
- Throws:
IOException
- on file errorsClassNotFoundException
- if there some error when creating the classes.IllegalAccessException
InstantiationException
-
getScenarioDirectory
Gets the scenario directory.- Returns:
- the scenario directory.
-
setScenarioDirectory
Sets the scenario directory. -
addParameterSetter
-
removeParameterSetter
-
getParameterSetters
-
addMasterControllerAction
Adds the specified ControllerAction to the master context.- Parameters:
action
- the action to add
-
removeMasterControllerAction
Removes the specified ControllerAction to the master context.- Parameters:
action
- the action to remove
-
getMasterControllerActions
Gets all the user added master controller actions.- Returns:
- all the user added master controller actions.
-
setControllerRegistry
-
getControllerRegistry
-
getModelInitName
-
setModelInitName
-
getModelPluginPath
-
setModelPluginPath
-
isDirty
public boolean isDirty()Gets whether or not this scenario is dirty, i.e. its current state is not saved.- Returns:
- true if this scenario is dirty, otherwise false.
-
setDirty
public void setDirty(boolean dirty) Set the dirty flag on this scenario. -
scenarioChanged
Description copied from interface:ScenarioChangedListener
Called whenever the Scenario has changed.- Specified by:
scenarioChanged
in interfaceScenarioChangedListener
-