Package nl.tue.astar.util
Class PartiallyOrderedTrace
- java.lang.Object
-
- nl.tue.astar.util.AbstractTrace
-
- nl.tue.astar.util.PartiallyOrderedTrace
-
- All Implemented Interfaces:
Trace
public class PartiallyOrderedTrace extends AbstractTrace
-
-
Field Summary
Fields Modifier and Type Field Description protected intedgeCountprotected int[][]predecessors-
Fields inherited from class nl.tue.astar.util.AbstractTrace
activities, label
-
-
Constructor Summary
Constructors Constructor Description PartiallyOrderedTrace(java.lang.String label, int numEvents)PartiallyOrderedTrace(java.lang.String label, int[] activitySequence)PartiallyOrderedTrace(java.lang.String label, int[] activitySequence, int[][] predecessors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)intgetEdgeCount()gnu.trove.TIntCollectiongetNextEvents(boolean[] executed)Returns a TIntCollection containing all events that are currently enabled, given a boolean array indicating which events have been executed so far.gnu.trove.TIntCollectiongetNextEvents(BitMask bitMask)Returns a TIntCollection containing all events that are currently enabled, given a bitmask for a booleanint[]getPredecessors(int index)returns the predecessors of the event at the given index.inthashCode()booleanisEnabled(int index, boolean[] executed)Returns true if and only if the event at the given index is enabled, given that those events for which executed is true have been executed.voidsetPredecessors(int event, int... predecessors)sets the predecessors for the event at index event.
-
-
-
Constructor Detail
-
PartiallyOrderedTrace
public PartiallyOrderedTrace(java.lang.String label, int numEvents)
-
PartiallyOrderedTrace
public PartiallyOrderedTrace(java.lang.String label, int[] activitySequence)
-
PartiallyOrderedTrace
public PartiallyOrderedTrace(java.lang.String label, int[] activitySequence, int[][] predecessors)
-
-
Method Detail
-
setPredecessors
public void setPredecessors(int event, int... predecessors)sets the predecessors for the event at index event. It is advisable to provide the predecessors in ascending order.- Parameters:
event-predecessors-
-
getPredecessors
public int[] getPredecessors(int index)
returns the predecessors of the event at the given index.- Parameters:
event-- Returns:
-
isEnabled
public boolean isEnabled(int index, boolean[] executed)Returns true if and only if the event at the given index is enabled, given that those events for which executed is true have been executed. More formally, returns true if and only if for all i in predecessors[index] holds that executed[i] == true and executed[i] == false This method checks the predecessors in descending order, if they are specified in ascending order.- Parameters:
index-executed-- Returns:
-
getNextEvents
public gnu.trove.TIntCollection getNextEvents(boolean[] executed)
Description copied from interface:TraceReturns a TIntCollection containing all events that are currently enabled, given a boolean array indicating which events have been executed so far.- Specified by:
getNextEventsin interfaceTrace- Overrides:
getNextEventsin classAbstractTrace- Returns:
-
getNextEvents
public gnu.trove.TIntCollection getNextEvents(BitMask bitMask)
Description copied from interface:TraceReturns a TIntCollection containing all events that are currently enabled, given a bitmask for a boolean- Specified by:
getNextEventsin interfaceTrace- Overrides:
getNextEventsin classAbstractTrace- Returns:
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classAbstractTrace
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractTrace
-
getEdgeCount
public int getEdgeCount()
-
-