StateManager used by SMC.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetEnabledProcesses(Integer state) intGet the id of a normalizedState.getLiveProcesses(Integer state) intGets the ID number of the process that is responsible for executing transition.getTransitions(Integer state, int pid) Given a state and a transition, returns the trace step after executing the transition at the given state.voidnormalize(TraceStepIF<Integer> traceStep) Normalize/simplify a state.voidPrints out all the states, in long form, currently "held" by this manager.voidPrints out all the states, in short form, currently "held" by this manager.voidprintStateLong(PrintStream out, Integer state) Prints out a long human-readable representation of the state.voidprintStateShort(PrintStream out, Integer state) Prints out a short human-readable representation of the state.voidprintTraceStep(Integer sourceState, TraceStepIF<Integer> traceStep) This method should print the source state id and transitions within this traceStep.voidprintTraceStepFinalState(Integer finalState, int normalizedID) This method should print the final state of a trace step.voidprintTransitionLong(PrintStream out, String transition) Prints out a long human-readable representation of the transition.voidprintTransitionShort(PrintStream out, String transition) Prints out a short human-readable representation of the transition.tryNextState(Integer state, String transition) Same asStateManager.nextState(STATE,TRANSITION)except if an error is encountered then it is not reported and null is returnedMethods inherited from class dev.civl.gmc.seq.StateManager
setGetIdFunction
-
Constructor Details
-
SimpleStateManager
-
-
Method Details
-
nextState
Description copied from class:StateManagerGiven a state and a transition, returns the trace step after executing the transition at the given state. SeeTraceStepIF.- Specified by:
nextStatein classStateManager<Integer,String> - Parameters:
state- a state in the state transition systemtransition- a transition which is enabled at the given state- Returns:
- the trace step after executing the transition at the given state.
-
tryNextState
Description copied from class:StateManagerSame asStateManager.nextState(STATE,TRANSITION)except if an error is encountered then it is not reported and null is returned- Specified by:
tryNextStatein classStateManager<Integer,String> - Parameters:
state- a state in the state transition systemtransition- an transition which is enabled at the given state- Returns:
- the trace step after executing the transition at the given state.
-
getId
Description copied from class:StateManagerGet the id of a normalizedState.- Overrides:
getIdin classStateManager<Integer,String> - Parameters:
normalizedState- The State of which you want the id.- Returns:
- the id of the normalizedState.
-
normalize
Description copied from class:StateManagerNormalize/simplify a state. It takes a
TraceStepIFas input since normalize always happens afterStateManager.nextState(Object, Object)which will return aTraceStepIFand normalize may need information fromTraceStepIF.Note that each distinct state (not equal with each other) will only normalized once. Since when a unnormalized state is seen again, you can get its normalized state through its associated
SequentialNode.- Specified by:
normalizein classStateManager<Integer,String>
-
printStateShort
Description copied from class:StateManagerPrints out a short human-readable representation of the state. This is intended to be something like "State 13", or something similar.- Specified by:
printStateShortin classStateManager<Integer,String> - Parameters:
out- the stream to which to send the outputstate- any state in the state transition system
-
printStateLong
Description copied from class:StateManagerPrints out a long human-readable representation of the state. This is intended to show all the details of the state, e.g., the values of all variables, etc.- Specified by:
printStateLongin classStateManager<Integer,String> - Parameters:
out- the stream to which to send the outputstate- any state in the state transition system
-
printTransitionShort
Description copied from class:StateManagerPrints out a short human-readable representation of the transition.- Specified by:
printTransitionShortin classStateManager<Integer,String> - Parameters:
out- the stream to which to send the outputtransition- any transition in the state transition system
-
printTransitionLong
Description copied from class:StateManagerPrints out a long human-readable representation of the transition. This is intended to show all details of the transition.- Specified by:
printTransitionLongin classStateManager<Integer,String> - Parameters:
out- the stream to which to send the outputtransition- any transition in the state transition system
-
printAllStatesShort
Description copied from class:StateManagerPrints out all the states, in short form, currently "held" by this manager. It is up to each implementation to decide what states are "held".- Specified by:
printAllStatesShortin classStateManager<Integer,String> - Parameters:
out- the stream to which to send the output
-
printAllStatesLong
Description copied from class:StateManagerPrints out all the states, in long form, currently "held" by this manager. It is up to each implementation to decide what states are "held".- Specified by:
printAllStatesLongin classStateManager<Integer,String> - Parameters:
out- the stream to which to send the output
-
printTraceStep
Description copied from class:StateManagerThis method should print the source state id and transitions within this traceStep. Note that this method should not print the final state in the traceStep.- Specified by:
printTraceStepin classStateManager<Integer,String> - Parameters:
traceStep- The traceStep you want to print
-
printTraceStepFinalState
Description copied from class:StateManagerThis method should print the final state of a trace step. So a complete print of a trace step consists of a call to
StateManager.printTraceStep(Object, TraceStepIF)and a call to this method.When this method is called, the final state of the traceStep is already normalized if (-saveStates option is enabled).
- Specified by:
printTraceStepFinalStatein classStateManager<Integer,String> - Parameters:
finalState- The final state of a trace stepnormalizedID- The ID of a normalized state (-1, if -saveStates option is diabled). see alsoStateManager.getId(Object)
-
getPid
Description copied from class:StateManagerGets the ID number of the process that is responsible for executing transition. This is used for the preemption-bounding search. If not doing preemption-bounded search, this method is not used. The preemption-bounded search determines if the given transition is a preemption if the PID is different from the PID of the previous transition but there is a transition in the enabled (or ample) set with the PID of the previous transition.- Specified by:
getPidin classStateManager<Integer,String> - Parameters:
transition- a non-null transition- Returns:
- a PID of the given transition
-
debug
- Specified by:
debugin classStateManager<Integer,String>
-
getEnabledProcesses
- Specified by:
getEnabledProcessesin classStateManager<Integer,String>
-
getLiveProcesses
- Specified by:
getLiveProcessesin classStateManager<Integer,String>
-
getTransitions
- Specified by:
getTransitionsin classStateManager<Integer,String>
-