Package org.mpi_sws.jmc.strategies.trust
Class ExplorationStack
java.lang.Object
org.mpi_sws.jmc.strategies.trust.ExplorationStack
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents an item in the exploration stack.static enumRepresents the item type in the exploration stack. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the stack.Gets the graph associated with the item.booleanisEmpty()Checks if the stack is empty.voidLogs the current state of the stack.peek()Peeks at the item at the top of the stack.pop()Pops an item from the stack.voidpush(ExplorationStack.Item item) Pushes an item onto the stack.intsize()Gets the size of the stack.
-
Constructor Details
-
ExplorationStack
public ExplorationStack()Creates a new exploration stack.
-
-
Method Details
-
push
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
Pops an item from the stack. If the stack is empty, null is returned.- Returns:
- The item popped from the stack
-
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
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.
-