Module dev.civl.gmc

Class SequentialNode<STATE>

java.lang.Object
dev.civl.gmc.seq.SequentialNode<STATE>

public class SequentialNode<STATE> extends Object
A Node in the state graph for the sequential depth first search.
  • Constructor Details

    • SequentialNode

      public SequentialNode(STATE state, int id)
  • Method Details

    • setSeen

      public void setSeen(boolean value)
      Sets the "seen flag" to a given value.

      The seen flag is intended to be used by a depth-first search algorithm, to mark that a state has been encountered in the search.

      Parameters:
      value - the value you want to assign to the seen flag associated to that state
    • getSeen

      public boolean getSeen()
      Returns the value of the seen flag associated to the given state.
      Parameters:
      state - any state in the state transition system
      Returns:
      the value of that state's seen flag.
    • setStackPosition

      public void setStackPosition(int stackPosition)

      Set the stack position field of the SequentialNode.

      The "stack position" field is intended to be used by a depth-first search algorithm, to mark that a state is currently on the depth-first search stack.

      The bottom element in the stack will have an index 0.

      Parameters:
      value - The value assigned to the stack position filed.
    • getStackPosition

      public int getStackPosition()
      Get the position of this SequentialNode on dfs stack or -1 if it is not on stack.
      Returns:
      position of this state on dfs stack or -1
    • getFullyExpanded

      public boolean getFullyExpanded()
      Returns:
      true iff the target SequentialNode has been expanded.
    • setFullyExpanded

      public void setFullyExpanded(boolean value)
      Set fullyExpanded to a certain value.
      Parameters:
      value - The value that is assigned to fullyExpanded field.
    • setExpand

      public void setExpand(boolean expand)
      Set expand to a given value.
      Parameters:
      expand - The value that is assigned to expand.
    • getExpand

      public boolean getExpand()
      Returns:
      the value of expand.
    • getDepth

      public int getDepth()
      Returns:
      the value of depth.
    • setDepth

      public void setDepth(int depth)
      Set depth to a given value.
      Parameters:
      depth - The value that is assigned to depth.
    • getState

      public STATE getState()
      Returns:
      the STATE this SequentialNode wraps.
    • getId

      public int getId()