public final class EfsmSimulator extends Simulator
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ENGINE_ID
The engine ID of all
EfsmSimulator instances. |
Constructor and Description |
---|
EfsmSimulator(Efsm efsm)
Constructs a simulator above the specified EFSM.
|
Modifier and Type | Method and Description |
---|---|
EfsmTransitionCoverage |
getCoverage()
Returns a test coverage reached during simulation since last reset.
|
EfsmState |
getCurrentState()
Returns a state of an underlying EFSM which this simulator is currently in.
|
ru.ispras.fortress.expression.NodeValue |
getInnerValue(java.lang.String name)
Returns a value of the specified inner variable of this simulator.
|
java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> |
getInnerValues()
Returns values of all inner variables of this simulator.
|
java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> |
getInnerValues(java.util.Collection<java.lang.String> names)
Returns values of the specified inner variables of this simulator.
|
EfsmTransition |
getLastTraversedTransition()
Returns a transition which was traversed by this simulator on last cycle.
|
java.lang.String |
getName()
Returns a name of this simulator.
|
ru.ispras.fortress.expression.NodeValue |
getOutputValue(java.lang.String name)
Returns a value of the specified output variable of this simulator.
|
java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> |
getOutputValues()
Returns values of all output variables of this simulator.
|
java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> |
getOutputValues(java.util.Collection<java.lang.String> names)
Returns values of the specified output variables of this simulator.
|
Efsm |
getStaticModel()
Returns an EFSM which this simulator is based on.
|
void |
loadSnapshot(EfsmSimulationSnapshot snapshot)
Restores a simulation state from the specified snapshot.
|
EfsmSimulationSnapshot |
makeSimulationSnapshot()
Returns a snapshot representing a current state of the simulation.
|
void |
processEvents(EventList events)
Handles the specified events.
|
void |
reset()
Resets this simulator, that is, returns it to an uninitialised state.
|
void |
setInputValue(java.lang.String name,
ru.ispras.fortress.expression.NodeValue value)
Sets the specified input of this simulator to the specified value.
|
void |
setInputValues(java.util.Collection<Transaction> transactions)
Sets the specified inputs of this simulator to the specified values.
|
Sequence |
start(java.util.Map<EntityType,Entity> inputs)
Simulates the specified input sequence producing an output sequence.
|
addBackend, addInputType, addParameter, defines, equals, getId, getInputTypes, getLogger, getOutputType, getParameters, hasBackEnds, hashCode, parseCommandLine, runBackEnds, setOutputType, setProgress, start, toString, uses
public static final java.lang.String ENGINE_ID
EfsmSimulator
instances.public EfsmSimulator(Efsm efsm)
efsm
- an EFSM which the simulator is based onEfsm.getInitialState()
,
Efsm.getResetGuardedActions()
public EfsmSimulationSnapshot makeSimulationSnapshot()
public void loadSnapshot(EfsmSimulationSnapshot snapshot)
snapshot
- the snapshotpublic Efsm getStaticModel()
getStaticModel
in class Simulator
public java.lang.String getName()
public EfsmState getCurrentState()
getCurrentState
in class Simulator
null
if called immediately after
construction/reset of this simulatorreset()
,
Efsm.getResetGuardedActions()
public EfsmTransition getLastTraversedTransition()
public EfsmTransitionCoverage getCoverage()
getCoverage
in class Simulator
public void reset()
public Sequence start(java.util.Map<EntityType,Entity> inputs)
public void processEvents(EventList events)
events
- the events to be processedpublic void setInputValue(java.lang.String name, ru.ispras.fortress.expression.NodeValue value)
Simulator
setInputValue
in class Simulator
name
- a name of the modified inputvalue
- the value to be setpublic void setInputValues(java.util.Collection<Transaction> transactions)
Simulator
setInputValues
in class Simulator
transactions
- transactions containing the inputs and the corresponding valuespublic ru.ispras.fortress.expression.NodeValue getInnerValue(java.lang.String name) throws java.lang.IllegalArgumentException
Simulator
getInnerValue
in class Simulator
name
- a name of the inner variablejava.lang.IllegalArgumentException
- if the specified variable is not found among the simulator
inner variablespublic java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> getInnerValues(java.util.Collection<java.lang.String> names)
Simulator
getInnerValues
in class Simulator
names
- a collection containing names of the inner variablespublic java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> getInnerValues()
Simulator
getInnerValues
in class Simulator
public ru.ispras.fortress.expression.NodeValue getOutputValue(java.lang.String name) throws java.lang.IllegalArgumentException
Simulator
getOutputValue
in class Simulator
name
- a name of the outputjava.lang.IllegalArgumentException
- if the specified variable is not found among the simulator
outputspublic java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> getOutputValues(java.util.Collection<java.lang.String> names)
Simulator
getOutputValues
in class Simulator
names
- a collection containing names of the outputspublic java.util.Map<java.lang.String,ru.ispras.fortress.expression.NodeValue> getOutputValues()
Simulator
getOutputValues
in class Simulator