java.lang.Object
dev.civl.gmc.dpor.DporNodeFactory<STATE,TRANSITION>
- All Implemented Interfaces:
GetIdFunction<STATE>
-
Constructor Summary
ConstructorsConstructorDescriptionDporNodeFactory(StateManager<STATE, TRANSITION> stateManager, boolean saveStates) -
Method Summary
Modifier and TypeMethodDescriptiongetAssociatedNode(STATE state) Get the node associated to the given state, null if there is no such a node.intgetInitialNode(STATE initState) Get theassociated with the initial state.invalid reference
SequentialNodegetNode(TraceStepIF<STATE> traceStep) Implements the fly-weight pattern and normalize a state.int
-
Constructor Details
-
DporNodeFactory
-
-
Method Details
-
getNode
Implements the fly-weight pattern and normalize a state. Note that only normalized and canonical state will have id.
- Returns:
- Left component: the existing
DporNodemapped to the state, or a newDporNodemapped to the state if there was no entry in the map for the key state. Note that theDporNodewill always store the normalized or simplified version ofstate. Right component: whether the returned node has been seen before (i.e. true iff we got it from storage)
-
getAssociatedNode
Get the node associated to the given state, null if there is no such a node.- Parameters:
state- The state whose associated node will be returned.- Returns:
- the node associated to the given state, null there is no such a node.
-
numOfSearchNodeSaved
public int numOfSearchNodeSaved()- Returns:
- the number of search nodes saved.
-
getInitialNode
Get theassociated with the initial state.invalid reference
SequentialNode- Parameters:
initState-- Returns:
-
getId
- Specified by:
getIdin interfaceGetIdFunction<STATE>
-