Package repast.simphony.batch
Class BatchRunner
java.lang.Object
repast.simphony.batch.BatchRunner
- All Implemented Interfaces:
RunListener
Runs a simulation in batch mode.
- Author:
- Nick Collier
-
Field Summary
Modifier and TypeFieldDescriptionprotected Controller
protected Object
protected boolean
protected SweeperProducer
-
Constructor Summary
ConstructorDescriptionBatchRunner
(boolean interactive) BatchRunner
(boolean interactive, int runNumber) -
Method Summary
Modifier and TypeMethodDescriptionvoid
createScenario
(BatchScenarioCreator creator) protected boolean
void
loadScenario
(File scenarioDir) protected void
void
paused()
Invoked when the current run has been paused.protected void
printMemoryStats
(String header) void
Invoked when the current run has been restarted after a pause.protected void
run()
void
Run a pre-built scenario.void
run
(BatchScenarioCreator creator) Run a scenario created from the specified BatchScenarioCreator.void
setSweeperProducer
(SweeperProducer producer) void
started()
Invoked when the current run has been started.void
stopped()
Invoked when the current run has been stopped.protected void
-
Field Details
-
controller
-
pause
protected boolean pause -
monitor
-
producer
-
-
Constructor Details
-
BatchRunner
public BatchRunner(boolean interactive) -
BatchRunner
public BatchRunner(boolean interactive, int runNumber) -
BatchRunner
public BatchRunner()
-
-
Method Details
-
getSweeperProducer
-
setSweeperProducer
-
run
Run a pre-built scenario.- Parameters:
scenarioDir
-- Throws:
org.java.plugin.PluginLifecycleException
saf.core.runtime.PluginDefinitionException
IOException
ParserConfigurationException
SAXException
ClassNotFoundException
IllegalAccessException
InstantiationException
IntrospectionException
ParameterFormatException
ScenarioLoadException
-
loadScenario
- Throws:
ScenarioLoadException
-
run
Run a scenario created from the specified BatchScenarioCreator.- Parameters:
creator
- the creator- Throws:
ClassNotFoundException
IOException
-
createScenario
- Throws:
ClassNotFoundException
IOException
-
keepRunning
protected boolean keepRunning() -
run
protected void run() -
printMemoryStats
-
waitForRun
protected void waitForRun() -
notifyMonitor
protected void notifyMonitor() -
paused
public void paused()Invoked when the current run has been paused.- Specified by:
paused
in interfaceRunListener
-
restarted
public void restarted()Invoked when the current run has been restarted after a pause.- Specified by:
restarted
in interfaceRunListener
-
started
public void started()Invoked when the current run has been started.- Specified by:
started
in interfaceRunListener
-
stopped
public void stopped()Invoked when the current run has been stopped. This will stop this thread from waiting for the current run to finish.- Specified by:
stopped
in interfaceRunListener
-