Interface Controller
- All Superinterfaces:
IAction
- All Known Implementing Classes:
DefaultController
Interface representing the Controller for the simulation. This will handle the setup, execution,
and teardown of the model. This contains a set of
ControllerActions that perform the actual work, allowing this
to perform primarily as a container and orderer of the actions.- Author:
- Jerry Vos
-
Method Summary
Modifier and TypeMethodDescriptionvoidCleans up the action after a batch run (a set of runs).voidInitializes the action for a batch run (a set of runs).Retrieves the registry ofControllerActions that the controller will run.Retrieves the current RunState the controller is using.intGets the next batch number.intGets the next run number.Gets the ScheduleRunner that will be used to execute the model's schedule found through the RunState.voidCleans up the action after a run just occurred.runInitialize(Parameters params) Initializes the action for a single run (possibly one of many).runParameterSetters(Parameters params) Initializes the parameters for the current run.voidsetControllerRegistry(ControllerRegistry controllerRegistry) Sets the registry ofControllerActions that the controller will run.voidsetScheduleRunner(Runner scheduleRunner) Sets the ScheduleRunner that will be used to execute the model's schedule and found through the RunState.voidsetup()
-
Method Details
-
setControllerRegistry
Sets the registry ofControllerActions that the controller will run.- Parameters:
controllerRegistry- a registry used to find actions to run
-
getControllerRegistry
ControllerRegistry getControllerRegistry()Retrieves the registry ofControllerActions that the controller will run.- Returns:
- a registry used to find actions to run
-
getCurrentRunState
RunState getCurrentRunState()Retrieves the current RunState the controller is using.- Returns:
- the RunState the controller is currently using
-
setScheduleRunner
Sets the ScheduleRunner that will be used to execute the model's schedule and found through the RunState. This is used in the execute() phase of the controller.- Parameters:
scheduleRunner- the ScheduleRunner that will execute the model's schedule
-
batchInitialize
void batchInitialize()Initializes the action for a batch run (a set of runs). -
runParameterSetters
Initializes the parameters for the current run.- Parameters:
params- an optional parameters object that will have the parameters loaded into it- Returns:
- the parameters object that the parameters were loaded into
-
runInitialize
Initializes the action for a single run (possibly one of many). -
runCleanup
void runCleanup()Cleans up the action after a run just occurred. -
batchCleanup
void batchCleanup()Cleans up the action after a batch run (a set of runs). -
getScheduleRunner
Runner getScheduleRunner()Gets the ScheduleRunner that will be used to execute the model's schedule found through the RunState. This is used in the execute() phase of the controller.- Returns:
- the ScheduleRunner that will be used to execute the model's schedule.
-
getNextRunNumber
int getNextRunNumber()Gets the next run number. The next run number is the number assigned to the next run when runInitialize is called.- Returns:
- the next run number. The next run number is the number assigned to the next run when runInitialize is called.
-
getNextBatchNumber
int getNextBatchNumber()Gets the next batch number. The next batch number is the number assigned to the next batch when batchInitialize is called.- Returns:
- the next batch number. The next batch number is the number assigned to the next batch when batchInitialize is called.
-
setup
void setup()
-