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
FieldsModifier and TypeFieldDescriptionprotected ContextDatastatic final ControllerActionprotected booleanprotected Fileprotected List<ControllerAction>protected UserPathDataprotected Stringprotected Fileprotected List<ParameterSetter>protected ControllerRegistrystatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified ControllerAction to the master context.voidaddParameterSetter(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.booleanisDirty()Gets whether or not this scenario is dirty, i.e.voidRemoves the specified ControllerAction to the master context.voidremoveParameterSetter(ParameterSetter paramSetter) voidCalled whenever the Scenario has changed.voidsetControllerRegistry(ControllerRegistry registry) voidsetDirty(boolean dirty) Set the dirty flag on this scenario.voidsetModelInitName(String modelInitName) voidsetModelPluginPath(File modelPluginPath) voidsetScenarioDirectory(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.IllegalAccessExceptionInstantiationException
-
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:ScenarioChangedListenerCalled whenever the Scenario has changed.- Specified by:
scenarioChangedin interfaceScenarioChangedListener
-