Module dev.civl.gmc

Class ConcurrentNodeFactory<STATE,TRANSITION>

java.lang.Object
dev.civl.gmc.concurrent.ConcurrentNodeFactory<STATE,TRANSITION>

public class ConcurrentNodeFactory<STATE,TRANSITION> extends Object
  • Constructor Details

  • Method Details

    • getNode

      public ConcurrentNode<STATE> getNode(STATE state)
      Implements the fly-weight pattern.
      Parameters:
      state -
      Returns:
      the existing
      invalid reference
      SequentialNode
      mapped to the state, or a new
      invalid reference
      SequentialNode
      mapped to the state if there was no entry in the map for the key state. Note that the
      invalid reference
      SequentialNode
      will always store the normalized or simplified version of state.
    • newStackEntry

      public StackEntry<STATE,TRANSITION> newStackEntry(ConcurrentNode<STATE> node, Collection<TRANSITION> transitions, boolean full)
      Construct a new stack entry which will be pushed onto the stack.
      Parameters:
      node - The
      invalid reference
      SequentialNode
      that wraps the source state.
      transitions - This could be the ample set or ample set complement of the source state.
      full - Whether transitions is ample set complement or not.
      Returns:
      The newly constructed StackEntry.
    • numOfSearchNodeSaved

      public int numOfSearchNodeSaved()
      Returns:
      the number of search nodes saved.