Class ExplorationStack

java.lang.Object
org.mpi_sws.jmc.strategies.trust.ExplorationStack

public class ExplorationStack extends Object
The exploration stack used in the Trust algorithm. The stack is used to keep track of the forward and backward revisits.

The stack is a list of inner stacks. Each inner stack is created for a backward revisit.

  • Constructor Details

    • ExplorationStack

      public ExplorationStack()
      Creates a new exploration stack.
  • Method Details

    • push

      public void push(ExplorationStack.Item item)
      Pushes an item onto the stack. If the stack is empty, a new InnerStack is created and added to the stack. If the item is a backward revisit, a new InnerStack is created and added to the stack.

      If the item contains a graph then the graph of the inner stack is updated with this graph. The reasoning is that since it is a DFS based exploration, The updated graph will only change the relations of later events.

      Parameters:
      item - The item to push onto the stack
    • pop

      public ExplorationStack.Item pop()
      Pops an item from the stack. If the stack is empty, null is returned.
      Returns:
      The item popped from the stack
    • peek

      public ExplorationStack.Item peek()
      Peeks at the item at the top of the stack. If the stack is empty, null is returned.
      Returns:
      The item at the top of the stack
    • getGraph

      public ExecutionGraph getGraph(ExplorationStack.Item item)
      Gets the graph associated with the item.
      Parameters:
      item - The item
      Returns:
      The graph associated with the item
    • isEmpty

      public boolean isEmpty()
      Checks if the stack is empty.
      Returns:
      True if the stack is empty, false otherwise
    • clear

      public void clear()
      Clears the stack.
    • size

      public int size()
      Gets the size of the stack.
      Returns:
      The size of the stack
    • logStackState

      public void logStackState()
      Logs the current state of the stack. This is a placeholder method for debugging purposes.