public class EfficientTree
extends java.lang.Object
implements java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
static int |
childrenFactor |
static int |
concurrent |
static int |
interleaved |
static int |
loop |
static int |
or |
static int |
sequence |
static int |
skip |
static int |
tau |
static int |
xor |
| Constructor and Description |
|---|
EfficientTree(int[] tree,
gnu.trove.map.TObjectIntMap<java.lang.String> activity2int,
java.lang.String[] int2activity)
Construct a new efficient tree using the given inputs.
|
EfficientTree(org.processmining.processtree.Node node) |
EfficientTree(org.processmining.processtree.ProcessTree processTree) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(int parent,
int asChildNr,
int operatorOrActivity)
Add a child to the tree, as a child of parent, at the given position.
|
EfficientTree |
clone() |
boolean |
equals(java.lang.Object obj) |
int |
getActivity(int node) |
gnu.trove.map.TObjectIntMap<java.lang.String> |
getActivity2int() |
java.lang.String |
getActivityName(int node) |
int |
getChild(int parent,
int numberOfChild) |
java.lang.Iterable<java.lang.Integer> |
getChildren(int node) |
int[] |
getChildTree(int node) |
static gnu.trove.map.TObjectIntMap<java.lang.String> |
getEmptyActivity2int() |
java.lang.String[] |
getInt2activity() |
int |
getNumberOfChildren(int node) |
int |
getOperator(int node) |
int |
getParent(int node)
Returns the parent of node.
|
int |
getRoot() |
int[] |
getTree() |
int |
hashCode() |
boolean |
isActivity(int node) |
boolean |
isConcurrent(int node) |
boolean |
isConsistent() |
boolean |
isInterleaved(int node) |
boolean |
isLoop(int node) |
boolean |
isOperator(int node) |
boolean |
isOr(int node) |
boolean |
isRoot(int node) |
boolean |
isSequence(int node) |
boolean |
isSkip(int node) |
boolean |
isTau(int node) |
boolean |
isXor(int node) |
void |
removeChild(int parent,
int child)
Remove a child of a node.
|
void |
replaceNodeWithTau(int node)
Replace a node and all of its children by a single tau.
|
void |
replaceTree(int[] tree)
Replace the tree structure.
|
void |
setOperator(int node,
int operator) |
EfficientTree |
shortenTree()
Copy the tree into a tight array
|
java.lang.String |
toString()
Return a string representation of this tree.
|
void |
toString(int node,
java.lang.StringBuilder result) |
Triple<int[],gnu.trove.map.TObjectIntMap<java.lang.String>,java.lang.String[]> |
toTriple() |
int |
traverse(int node) |
static Triple<int[],gnu.trove.map.TObjectIntMap<java.lang.String>,java.lang.String[]> |
tree2efficientTree(org.processmining.processtree.Node node)
Convert a process tree into a efficient tree
|
public static final int tau
public static final int xor
public static final int sequence
public static final int concurrent
public static final int interleaved
public static final int loop
public static final int skip
public static final int or
public static final int childrenFactor
public EfficientTree(int[] tree,
gnu.trove.map.TObjectIntMap<java.lang.String> activity2int,
java.lang.String[] int2activity)
tree - activity2int - The mapping from activities (strings) to integers. The map
should be created such that the emptiness value is not 0 (as
that is a valid activity). Preferably, use
getEmptyActivity2int() to obtain such a map.int2activity - The mapping from integers to the activities (strings). Should
be consistent with activity2int.public EfficientTree(org.processmining.processtree.ProcessTree processTree)
throws UnknownTreeNodeException
UnknownTreeNodeExceptionpublic EfficientTree(org.processmining.processtree.Node node)
throws UnknownTreeNodeException
UnknownTreeNodeExceptionpublic Triple<int[],gnu.trove.map.TObjectIntMap<java.lang.String>,java.lang.String[]> toTriple()
public int[] getTree()
public gnu.trove.map.TObjectIntMap<java.lang.String> getActivity2int()
public java.lang.String[] getInt2activity()
public static Triple<int[],gnu.trove.map.TObjectIntMap<java.lang.String>,java.lang.String[]> tree2efficientTree(org.processmining.processtree.Node node) throws UnknownTreeNodeException
tree - activity2int - map from activity names to ints >= 0UnknownTreeNodeExceptionpublic void addChild(int parent,
int asChildNr,
int operatorOrActivity)
parent - asChildNr - public int traverse(int node)
node - public int getActivity(int node)
node - public java.lang.String getActivityName(int node)
tree - node - public boolean isOperator(int node)
node - public int getNumberOfChildren(int node)
node - public boolean isRoot(int node)
node - public int getChild(int parent,
int numberOfChild)
parent - numberOfChild - public boolean isTau(int node)
node - public boolean isActivity(int node)
node - public boolean isSequence(int node)
i - public boolean isXor(int node)
node - public boolean isConcurrent(int node)
node - public boolean isInterleaved(int node)
node - public boolean isLoop(int node)
node - public boolean isOr(int node)
node - public int getOperator(int node)
node - public int getRoot()
public java.lang.Iterable<java.lang.Integer> getChildren(int node)
node - public void removeChild(int parent,
int child)
parent - child - public void replaceNodeWithTau(int node)
tree - node - public EfficientTree shortenTree()
tree - public boolean isConsistent()
public boolean isSkip(int node)
node - public void setOperator(int node,
int operator)
public int[] getChildTree(int node)
public static gnu.trove.map.TObjectIntMap<java.lang.String> getEmptyActivity2int()
public int getParent(int node)
node - public void replaceTree(int[] tree)
newTree - public java.lang.String toString()
toString in class java.lang.Objectpublic void toString(int node,
java.lang.StringBuilder result)
throws UnknownTreeNodeException
UnknownTreeNodeExceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic EfficientTree clone()
clone in class java.lang.Object