Package microsim.engine
Class MultiRun
java.lang.Object
java.lang.Thread
microsim.engine.MultiRun
- All Implemented Interfaces:
Runnable
,EngineListener
,ExperimentBuilder
MultiRun is a template abstract class useful to guide the modeller to build an automatic simulation launcher, able
to change interactively parameters on the basis of the last run.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Modifier and TypeFieldDescriptionprotected static boolean
Sets whether to copy the input files into a new input folder within a new output folder for each simulation runprotected int
protected SimulationEngine
protected boolean
protected boolean
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddParameterDomain
(@NonNull ParameterDomain parameterDomain) getConfiguration
(int counter) int
void
go()
The go method starts the multi-run simulation.abstract boolean
When a SIMULATION_END signal is sent to JAS by one of the running models, simulation is stopped and this method is called.void
onEngineEvent
(@NonNull SystemEventType event) This method monitors theSystemEventType.End
signal.void
run()
MultiRun is an independent thread.abstract String
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface microsim.engine.ExperimentBuilder
buildExperiment
-
Field Details
-
copyInputFolderStructure
protected static boolean copyInputFolderStructureSets whether to copy the input files into a new input folder within a new output folder for each simulation run -
engine
-
counter
protected int counter -
executionActive
protected boolean executionActive -
toBeContinued
protected boolean toBeContinued
-
-
Constructor Details
-
MultiRun
public MultiRun()Create a new multi run session.
-
-
Method Details
-
nextModel
public abstract boolean nextModel()When a SIMULATION_END signal is sent to JAS by one of the running models, simulation is stopped and this method is called. If it returns true the multi run will continue with the next run, otherwise the program will exit.- Returns:
- a value deciding if simulation is to be continued.
-
setupRunLabel
-
run
public void run()MultiRun is an independent thread. The run method controls the sequence of simulations. -
go
public void go()The go method starts the multi-run simulation. -
onEngineEvent
This method monitors theSystemEventType.End
signal. When it is raised the MultiRun class stops current run and invokes thenextModel()
method.- Specified by:
onEngineEvent
in interfaceEngineListener
- Parameters:
event
- ASystemEventType
event.
-
addParameterDomain
-
getMaxConfigurations
public int getMaxConfigurations() -
getConfiguration
-