public abstract class AbstractSimulatingDriver extends AbstractDriver implements Simulating, Preserving
| Modifier and Type | Field and Description |
|---|---|
private double |
accelerate |
private TimeKeeper |
commandtimes
For recording the various times.
|
static String |
KEY_KEEPCOMMANDTIMES
Save the roof times to this file for simulator mode.
|
private long |
simulate |
KEY_DRIVERNAMEKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASS| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSimulatingDriver(Map<String,String> info)
Initializes a time-keeper object as a storage space for non-simulated
command execution times.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accelerate(double by)
Accelerates the time flow by the stated factor.
|
void |
addCommandTime(Object command,
double time) |
void |
exit() |
protected double |
getAcceleration() |
double |
getCommandTimeAverage(Object command) |
double |
getCommandTimeRandomSample(Object command) |
double |
getCommandTimeSigma(Object command) |
protected long |
getSimulationStart() |
protected boolean |
isSimulate() |
boolean |
preserve()
On exit, we save our current state if the serialize property is set.
|
boolean |
restore()
We restore our old value by reading the last date and target count from
a serialization file.
|
protected long |
simulateSince() |
boolean |
startSimulate()
A driver can be put into simulation mode only before it has been opened,
otherwise an illegal state exception is thrown.
|
boolean |
stopSimulate()
Stops the simulation.
|
createDriver, equals, getDriverName, hashCodeaugment, augment, augment, augment, augment, clone, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, initProperties, isNew, parseObject, parseObject, reload, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitinitpublic static final String KEY_KEEPCOMMANDTIMES
private TimeKeeper commandtimes
private double accelerate
private long simulate
public void addCommandTime(Object command, double time)
public double getCommandTimeAverage(Object command)
public double getCommandTimeSigma(Object command)
public double getCommandTimeRandomSample(Object command)
public void exit()
exit in interface ExitCleaningpublic boolean startSimulate()
startSimulate in interface Simulatingpublic boolean stopSimulate()
stopSimulate in interface Simulatingpublic boolean accelerate(double by)
throws UnsupportedOperationException
accelerate in interface SimulatingUnsupportedOperationExceptionprotected boolean isSimulate()
protected long getSimulationStart()
protected long simulateSince()
protected double getAcceleration()
public boolean restore()
restore in interface Preservingpublic boolean preserve()
preserve in interface Preserving