public abstract class Simulator<T extends DecStatement> extends java.lang.Object implements Simulated
Modifier and Type | Field and Description |
---|---|
protected HashMapMemory |
outputsMemory |
protected HashMapMemory |
regMemory |
protected T |
simulatedModel |
Modifier | Constructor and Description |
---|---|
protected |
Simulator(T simulatedModel)
Constructs a simulator for the specified model.
|
Modifier and Type | Method and Description |
---|---|
HashMapMemory |
getInputsMemory()
Returns input variables and their values.
|
HashMapMemory |
getOutputsMemory()
Returns output variables and their values.
|
TestVector |
getOutputVector()
Returns output vector that is produced by this object.
|
HashMapMemory |
getRegMemory()
Returns internal variables and their values.
|
abstract T |
getSimulatedModel()
Returns a model which is simulated by this simulator.
|
ru.ispras.fortress.expression.NodeValue |
getVariableValue(java.lang.String variableName)
Returns value of variable with the specified name.
|
protected void |
loadSnapshot(SimulationSnapshot snapshot)
Restores a simulation state from the specified snapshot.
|
SimulationSnapshot |
makeSimulationSnapshot()
Returns a snapshot representing a current state of the simulation.
|
void |
readVector(TestVector vector)
Reads the specified values and puts them to internal memory.
|
protected void |
reset()
Resets this simulator, that is, returns it at the same state as it had immediately after
construction.
|
ru.ispras.fortress.expression.Node |
substituteVariables(ru.ispras.fortress.expression.Node expression,
java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> bufferedVariables)
Substitute variables in the expression by ones that are in mapping.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCoverage, getCurrentState, resetCoverage, simulateSequence, simulateVector
protected final T extends DecStatement simulatedModel
protected HashMapMemory regMemory
protected HashMapMemory outputsMemory
protected Simulator(T simulatedModel)
simulatedModel
- the simulated modelpublic abstract T getSimulatedModel()
public HashMapMemory getInputsMemory()
Simulated
getInputsMemory
in interface Simulated
public HashMapMemory getRegMemory()
Simulated
getRegMemory
in interface Simulated
public HashMapMemory getOutputsMemory()
Simulated
getOutputsMemory
in interface Simulated
protected void reset()
public ru.ispras.fortress.expression.Node substituteVariables(ru.ispras.fortress.expression.Node expression, java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> bufferedVariables)
expression
- The expression that should be transformed.bufferedVariables
- The "variable's name - node" mapping.public void readVector(TestVector vector)
vector
- The set of values to be read.public TestVector getOutputVector()
public ru.ispras.fortress.expression.NodeValue getVariableValue(java.lang.String variableName)
variableName
- variable namenull
otherwisepublic SimulationSnapshot makeSimulationSnapshot()
protected void loadSnapshot(SimulationSnapshot snapshot)
snapshot
- the snapshot