Module dev.civl.gmc

Class DporNodeFactory<STATE,TRANSITION>

java.lang.Object
dev.civl.gmc.dpor.DporNodeFactory<STATE,TRANSITION>
All Implemented Interfaces:
GetIdFunction<STATE>

public class DporNodeFactory<STATE,TRANSITION> extends Object implements GetIdFunction<STATE>
  • Constructor Details

  • Method Details

    • getNode

      public Pair<DporNode<STATE,TRANSITION>,Boolean> getNode(TraceStepIF<STATE> traceStep)

      Implements the fly-weight pattern and normalize a state. Note that only normalized and canonical state will have id.

      Returns:
      Left component: the existing DporNode mapped to the state, or a new DporNode mapped to the state if there was no entry in the map for the key state. Note that the DporNode will always store the normalized or simplified version of state. Right component: whether the returned node has been seen before (i.e. true iff we got it from storage)
    • getAssociatedNode

      public DporNode<STATE,TRANSITION> getAssociatedNode(STATE state)
      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

      public DporNode<STATE,TRANSITION> getInitialNode(STATE initState)
      Get the
      invalid reference
      SequentialNode
      associated with the initial state.
      Parameters:
      initState -
      Returns:
    • getId

      public int getId(STATE state)
      Specified by:
      getId in interface GetIdFunction<STATE>