Module dev.civl.gmc

Class StackEntry<STATE,TRANSITION>

java.lang.Object
dev.civl.gmc.seq.StackEntry<STATE,TRANSITION>
All Implemented Interfaces:
Iterator<TRANSITION>

public class StackEntry<STATE,TRANSITION> extends Object implements Iterator<TRANSITION>
The stack entry that is going to be pushed onto the stack during the search. The stack entry also serves as the iterator of the ample set or ample set complement of the source state.
  • Constructor Details

    • StackEntry

      public StackEntry(SequentialNode<STATE> node, Collection<TRANSITION> transitions, int offset)
      Parameters:
      node - The node that wraps the source state.
      transitions - The ample set or ample set complement of the source state.
      offset - the ID number that should be associated to the first transition in the sequence.
  • Method Details

    • peek

      public TRANSITION peek()
      Returns:
      the current transition but not move the transitionIterator.
    • next

      public TRANSITION next()
      Specified by:
      next in interface Iterator<STATE>
      Returns:
      the current transition and also move the transitionIterator.
    • getTid

      public int getTid()
    • getNode

      public SequentialNode<STATE> getNode()
    • getTransitionIterator

      public Iterator<TRANSITION> getTransitionIterator()
    • source

      public STATE source()
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<STATE>
    • getState

      public STATE getState()
    • getMinimumSuccessorStackIndex

      public int getMinimumSuccessorStackIndex()
    • setMinimumSuccessorStackIndex

      public void setMinimumSuccessorStackIndex(int minimumSuccessorStackIndex)
    • getTransitions

      public Collection<TRANSITION> getTransitions()
    • isPreemptible

      public boolean isPreemptible()
      Is this step preemptible, i.e., does the set of outgoing transitions include at least one transition from the previous process as well as at least one transition from another process?
      Returns:
      true iff this step is preemptible
    • getPreemptionPid

      public int getPreemptionPid()
      If this step is preemptible, this method returns the PID of the process that executed the previous transition. Otherwise the value returned is -1.
      Returns:
      previous process PID, if this step is preemptible, else -1
    • setPreemptionPid

      public void setPreemptionPid(int pid)
      Sets this entry to be preemptible, with the given pid to be the PID of the previous process.