public abstract class ZmtSimState extends SimState
SimState
s which can be automated need to extend this
class.Modifier and Type | Field and Description |
---|---|
static Path |
DEFAULT_INPUT_DIR
Default directory for loading the parameters from.
|
static Path |
DEFAULT_OUTPUT_DIR
Default directory to write simulation output.
|
Constructor and Description |
---|
ZmtSimState(long seed) |
Modifier and Type | Method and Description |
---|---|
String |
createStatusMessage(double stepRatePerS)
Creates a message to inform about the current status of the running
simulation.
|
void |
finish() |
Optional<? extends Output> |
getOutput()
Gets the output object of this simulation.
|
abstract SimParams |
getParams()
Returns the
SimParams object with the current configuration. |
abstract Class<? extends SimParams> |
getParamsClass()
Returns the
SimParams class used by this simulation. |
void |
setOutputPath(Path outputPath)
Sets the path to write simulation output.
|
abstract void |
setParams(SimParams params)
Sets the current configuration to the given
SimParams object. |
addToAsynchronousRegistry, asynchronousRegistry, awakeFromCheckpoint, doLoop, doLoop, job, kill, nameThread, postCheckpoint, preCheckpoint, primeGenerator, printlnSynchronized, readFromCheckpoint, readFromCheckpoint, removeFromAsynchronousRegistry, seed, setJob, setSeed, start, version, writeToCheckpoint, writeToCheckpoint
public static final Path DEFAULT_INPUT_DIR
public static final Path DEFAULT_OUTPUT_DIR
public String createStatusMessage(double stepRatePerS)
stepRatePerS
- the rate of steps per second measured by the simulation runnerpublic Optional<? extends Output> getOutput()
Optional
, can be overridden in sub classes. The returned object
can be inspected in GUI if selected in menu.public void setOutputPath(Path outputPath)
outputPath
- the new output pathpublic abstract Class<? extends SimParams> getParamsClass()
SimParams
class used by this simulation. Implementing
classes need to specify this in order to create and load suitable
parameter objects.
XStream
annotations are processed for this class and all which
are referenced.
SimParams
class used by this simulationpublic abstract SimParams getParams()
SimParams
object with the current configuration.SimParams
with the current configurationpublic abstract void setParams(SimParams params)
SimParams
object.params
- the SimParams
object containing the desired
configuration