public class NAryTreeEpisode
extends java.lang.Object
implements org.processmining.plugins.etm.model.narytree.NAryTree
Modifier and Type | Field and Description |
---|---|
protected int[] |
leafs
stores the index of the next leaf
|
protected int[] |
next
stores the index of the next node in the subtree under m
|
protected int |
numConfigurations
The current number of configurations
|
protected int[] |
parent
stored the index of the parent of a node m.
|
protected short[] |
type
stores the type of a node m.
|
protected short[][] |
types
stores the type of a node m for each configuration.
|
Modifier | Constructor and Description |
---|---|
protected |
NAryTreeEpisode(int size) |
|
NAryTreeEpisode(int[] next,
short[] type,
int[] parent) |
|
NAryTreeEpisode(java.util.List<java.lang.Integer> next,
java.util.List<java.lang.Short> type,
java.util.List<java.lang.Integer> parent) |
|
NAryTreeEpisode(org.processmining.plugins.etm.model.narytree.NAryTree original) |
|
NAryTreeEpisode(gnu.trove.list.TIntList next,
gnu.trove.list.TShortList type,
gnu.trove.list.TIntList parent) |
Modifier and Type | Method and Description |
---|---|
NAryTreeEpisode |
add(org.processmining.plugins.etm.model.narytree.NAryTree source,
int node,
int par,
int location)
Returns a new tree where the subtree below the node at index node in the
source tree is copied into this tree under node with index parent at
location index.
|
org.processmining.plugins.etm.model.narytree.NAryTree |
addChild(int operatorNode,
int location,
short leafType,
byte configurationType)
Returns a new tree in which a child is added to the operator at the given
index
|
void |
addConfiguration(org.processmining.plugins.etm.model.narytree.Configuration configuration)
adds the given configurations to the list of configurations.
|
org.processmining.plugins.etm.model.narytree.NAryTree |
addParent(int node,
short type,
byte configurationType)
Returns a new tree in which node from source is replaced by a new node of
the given type and where the existing node becomes a child of this newly
added parent.
|
NAryTreeEpisode |
addParent(int node,
short newType,
short newType2) |
org.processmining.plugins.etm.model.narytree.NAryTree |
applyConfiguration(int configurationNumber)
Applies a configuration to the tree and returns the result.
|
org.processmining.plugins.etm.model.narytree.NAryTree |
applyHidingAndOperatorDowngrading(int configurationNumber)
Apply all hiding and downgrading configurations of the provided
configuration number.
|
int |
compareTo(org.processmining.plugins.etm.model.narytree.NAryTree o) |
int |
countNodes(short type)
counts the number of nodes of the given type
|
boolean |
equals(java.lang.Object o)
returns true if all four internal arrays are identical.
|
protected static double |
expectedCol(int keys,
long vals) |
int |
findBlockEffect(int blockedNode)
Finds the effect of blocking a particular node.
|
int |
getChildAtIndex(int par,
int n)
returns the id of the n-th child of par.
|
org.processmining.plugins.etm.model.narytree.Configuration |
getConfiguration(int configurationNumber)
Returns the configuration stored at the given index.
|
protected int |
getHighestParentWithOneChild(int node)
returns the highest parent of the given node, such that this parent has
one child and all intermediate parents also have one child.
|
int |
getNext(int node)
returns the first node not in the subtree of the given node .
|
int |
getNextFast(int node)
returns the first node larger than the given node, which is not part of
the subtree of the given node.
|
int |
getNextLeaf(int node)
returns the leaf greater than the given node.
|
int |
getNextLeafFast(int node)
returns the leaf greater than the given node.
|
byte |
getNodeConfiguration(int configurationNumber,
int node)
returns the configuration of the node in the given configuration.
|
byte |
getNodeConfigurationFast(int configurationNumber,
int node) |
int |
getNumberOfConfigurations()
Returns the number of configurations.
|
int |
getParent(int node)
returns the parent of the given node.
|
int |
getParentFast(int node)
returns the parent of the given node.
|
short |
getType(int node)
returns the type of a node.
|
short |
getType(int configurationNumber,
int node)
returns the type of a node.
|
short |
getTypeFast(int node)
returns the type of a node.
|
short |
getTypeFast(int configurationNumber,
int node)
returns the type of a node.
|
int |
hashCode()
returns hashcode based on the internal arrays
|
int |
hashCode(int node) |
boolean |
isBlocked(int configurationNumber,
int node)
returns true if the given node is blocked in the given configuration
|
boolean |
isConsistent()
returns true if the tree is (internally) consistent
|
boolean |
isDowngraded(int configurationNumber,
int node) |
boolean |
isHidden(int configurationNumber,
int node)
returns true if the given node is hidden in the given configuration
|
boolean |
isInSubtree(int par,
int child)
returns if the child appears in the subtree of the parent
|
boolean |
isLeaf(int node)
returns true if a node is a leaf.
|
org.processmining.plugins.etm.model.narytree.NAryTree |
move(int node,
int newParent,
int location)
moves the given node by removing it from its parent and adding is under
the new parent.
|
org.processmining.plugins.etm.model.narytree.NAryTree |
move(int par,
int n,
int newParent,
int location)
moves the n-th child of the parent "par" by removing it from the tree and
inserting it as a new child under newParent.
|
int |
nChildren(int node)
returns the number of children of a node.
|
int |
numLeafs()
returns the number of leafs in the tree.
|
org.processmining.plugins.etm.model.narytree.NAryTree |
remove(int node)
removes the node at index node from the tre
|
org.processmining.plugins.etm.model.narytree.NAryTree |
remove(int par,
int index)
removes the child at index from node par.
|
void |
removeAllConfigurations() |
void |
removeConfiguration(int configurationNumber)
Removes the configuration at the given index from the list of
configurations.
|
org.processmining.plugins.etm.model.narytree.NAryTree |
replace(int par,
int n,
org.processmining.plugins.etm.model.narytree.NAryTree source,
int node)
replaces the n-th child of parent with the node from source.
|
NAryTreeEpisode |
replace(int node,
org.processmining.plugins.etm.model.narytree.NAryTree source,
int srcNode)
replaces node from this tree with the node from the source tree
It is assumed that this tree and the given tree have an equal number of
configurations.
|
protected void |
set(int index,
short typeVal,
int parentVal,
int nextVal)
Sets the values of the internal arrays according to the given parameters.
|
void |
setNodeConfiguration(int configurationNumber,
int node,
byte configurationOption)
Sets the configuration option for a node.
|
void |
setType(int par,
int n,
short t)
sets the type of the n-th child of parent par.
|
void |
setType(int index,
short t)
Sets the type of the node.
|
int |
size()
returns the number of nodes in the tree
|
int |
size(int node)
returns the size of the subtree under node
|
NAryTreeEpisode |
swap(int node1,
int node2)
returns a new tree with the two nodes swapped.
|
java.lang.String |
toInternalString()
returns a string representation of the internal datastructures of the
tree (for debugging only)
|
java.lang.String |
toString() |
protected int numConfigurations
protected final int[] next
protected final short[] type
protected short[][] types
protected final int[] parent
protected final int[] leafs
public NAryTreeEpisode(org.processmining.plugins.etm.model.narytree.NAryTree original)
public NAryTreeEpisode(int[] next, short[] type, int[] parent)
protected NAryTreeEpisode(int size)
public NAryTreeEpisode(gnu.trove.list.TIntList next, gnu.trove.list.TShortList type, gnu.trove.list.TIntList parent)
public NAryTreeEpisode(java.util.List<java.lang.Integer> next, java.util.List<java.lang.Short> type, java.util.List<java.lang.Integer> parent)
public boolean isConsistent()
org.processmining.plugins.etm.model.narytree.NAryTree
isConsistent
in interface org.processmining.plugins.etm.model.narytree.NAryTree
protected void set(int index, short typeVal, int parentVal, int nextVal)
index
- values
- public void setType(int index, short t)
org.processmining.plugins.etm.model.narytree.NAryTree
setType
in interface org.processmining.plugins.etm.model.narytree.NAryTree
index
- Index of the node to updatet
- Type to set the node topublic void setType(int par, int n, short t)
org.processmining.plugins.etm.model.narytree.NAryTree
setType
in interface org.processmining.plugins.etm.model.narytree.NAryTree
par
- the parent. This should not be a leaf.n
- the child numberpublic NAryTreeEpisode swap(int node1, int node2)
org.processmining.plugins.etm.model.narytree.NAryTree
swap
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node1
- First node to swapnode2
- Other node to swap withpublic NAryTreeEpisode add(org.processmining.plugins.etm.model.narytree.NAryTree source, int node, int par, int location)
org.processmining.plugins.etm.model.narytree.NAryTree
add
in interface org.processmining.plugins.etm.model.narytree.NAryTree
source
- NAryTree to add a node fromnode
- Node to add from the source tree to the current treepublic NAryTreeEpisode addParent(int node, short newType, short newType2)
public org.processmining.plugins.etm.model.narytree.NAryTree addChild(int operatorNode, int location, short leafType, byte configurationType)
org.processmining.plugins.etm.model.narytree.NAryTree
addChild
in interface org.processmining.plugins.etm.model.narytree.NAryTree
operatorNode
- node to which a child needs to be added (cannot be a leaf or a
LOOP)location
- the index at which the child should be added. 0 means the new
child becomes the leftmost, and any value greater than the
number of children implies the new node becomes the rightmost.leafType
- the new type of the new leaf node to be insertedpublic org.processmining.plugins.etm.model.narytree.NAryTree replace(int par, int n, org.processmining.plugins.etm.model.narytree.NAryTree source, int node)
org.processmining.plugins.etm.model.narytree.NAryTree
replace
in interface org.processmining.plugins.etm.model.narytree.NAryTree
par
- a node. If par is a leaf, then the parameter n is ignoredn
- the child to replace. if n==0, the leftmost child is replaced,
if n>= nChildren the rightmost is.source
- NAryTree to get the new node fromnode
- Node from the source tree to be the replacement in this treepublic NAryTreeEpisode replace(int node, org.processmining.plugins.etm.model.narytree.NAryTree source, int srcNode)
org.processmining.plugins.etm.model.narytree.NAryTree
replace
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Node in this tree to be replacedsource
- NAryTree to get the new node fromsrcNode
- Node from the source tree to be the replacement in this treepublic org.processmining.plugins.etm.model.narytree.NAryTree remove(int par, int index)
org.processmining.plugins.etm.model.narytree.NAryTree
remove
in interface org.processmining.plugins.etm.model.narytree.NAryTree
par
- the parent of the node to be removed. If par is a aleaf, a
clone is returnedindex
- Child index of the node to be removedpublic org.processmining.plugins.etm.model.narytree.NAryTree remove(int node)
org.processmining.plugins.etm.model.narytree.NAryTree
remove
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to be removedpublic org.processmining.plugins.etm.model.narytree.NAryTree move(int node, int newParent, int location)
org.processmining.plugins.etm.model.narytree.NAryTree
move
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Node to be (re)movednewParent
- Index of the new parentlocation
- Child index of the moved node in the parent nodepublic org.processmining.plugins.etm.model.narytree.NAryTree move(int par, int n, int newParent, int location)
org.processmining.plugins.etm.model.narytree.NAryTree
move
in interface org.processmining.plugins.etm.model.narytree.NAryTree
par
- Index of the parent of the node to be movedn
- Child index of the node to be movednewParent
- Index of the new parent of the moved nodelocation
- Child location in the parent of the moved nodepublic short getType(int node)
org.processmining.plugins.etm.model.narytree.NAryTree
getType
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to get the type forpublic short getTypeFast(int node)
org.processmining.plugins.etm.model.narytree.NAryTree
getTypeFast
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to get the type forpublic int getChildAtIndex(int par, int n)
org.processmining.plugins.etm.model.narytree.NAryTree
getChildAtIndex
in interface org.processmining.plugins.etm.model.narytree.NAryTree
par
- a non-leaf node from which the index of the n-th child to get
fromn
- -th child to return index forpublic int size(int node)
org.processmining.plugins.etm.model.narytree.NAryTree
size
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to get the size forpublic int nChildren(int node)
org.processmining.plugins.etm.model.narytree.NAryTree
nChildren
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to get the number of children forpublic boolean isInSubtree(int par, int child)
org.processmining.plugins.etm.model.narytree.NAryTree
isInSubtree
in interface org.processmining.plugins.etm.model.narytree.NAryTree
par
- Index of the parent node (/root of subtree) to searchchild
- Index (absolute) of the child node to search forpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
protected int getHighestParentWithOneChild(int node)
node
- public boolean isLeaf(int node)
org.processmining.plugins.etm.model.narytree.NAryTree
isLeaf
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to checkpublic int size()
org.processmining.plugins.etm.model.narytree.NAryTree
size
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public java.lang.String toInternalString()
org.processmining.plugins.etm.model.narytree.NAryTree
toInternalString
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public java.lang.String toString()
toString
in class java.lang.Object
public int getParent(int node)
org.processmining.plugins.etm.model.narytree.NAryTree
getParent
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to get the parent forpublic int getParentFast(int node)
org.processmining.plugins.etm.model.narytree.NAryTree
getParentFast
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to get the parent forpublic int getNext(int node)
getNext
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- public int getNextFast(int node)
org.processmining.plugins.etm.model.narytree.NAryTree
getNextFast
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to get the next node outside this subtree
forpublic int numLeafs()
org.processmining.plugins.etm.model.narytree.NAryTree
numLeafs
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public int compareTo(org.processmining.plugins.etm.model.narytree.NAryTree o)
compareTo
in interface java.lang.Comparable<org.processmining.plugins.etm.model.narytree.NAryTree>
public int getNextLeaf(int node)
org.processmining.plugins.etm.model.narytree.NAryTree
getNextLeaf
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to get the next leaf forpublic int getNextLeafFast(int node)
org.processmining.plugins.etm.model.narytree.NAryTree
getNextLeafFast
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to get the next leaf forpublic void addConfiguration(org.processmining.plugins.etm.model.narytree.Configuration configuration)
org.processmining.plugins.etm.model.narytree.NAryTree
addConfiguration
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public void removeConfiguration(int configurationNumber)
org.processmining.plugins.etm.model.narytree.NAryTree
removeConfiguration
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public int getNumberOfConfigurations()
org.processmining.plugins.etm.model.narytree.NAryTree
getNumberOfConfigurations
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public org.processmining.plugins.etm.model.narytree.Configuration getConfiguration(int configurationNumber)
org.processmining.plugins.etm.model.narytree.NAryTree
getConfiguration
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public boolean isBlocked(int configurationNumber, int node)
org.processmining.plugins.etm.model.narytree.NAryTree
isBlocked
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public boolean isHidden(int configurationNumber, int node)
org.processmining.plugins.etm.model.narytree.NAryTree
isHidden
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public boolean isDowngraded(int configurationNumber, int node)
public void setNodeConfiguration(int configurationNumber, int node, byte configurationOption)
org.processmining.plugins.etm.model.narytree.NAryTree
setNodeConfiguration
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public byte getNodeConfigurationFast(int configurationNumber, int node)
public byte getNodeConfiguration(int configurationNumber, int node)
org.processmining.plugins.etm.model.narytree.NAryTree
getNodeConfiguration
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public short getType(int configurationNumber, int node)
org.processmining.plugins.etm.model.narytree.NAryTree
getType
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to get the type forpublic short getTypeFast(int configurationNumber, int node)
org.processmining.plugins.etm.model.narytree.NAryTree
getTypeFast
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- Index of the node to get the type forpublic org.processmining.plugins.etm.model.narytree.NAryTree applyConfiguration(int configurationNumber)
org.processmining.plugins.etm.model.narytree.NAryTree
applyConfiguration
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public int findBlockEffect(int blockedNode)
findBlockEffect
in interface org.processmining.plugins.etm.model.narytree.NAryTree
blockedNode
- the node that is know to be blockedpublic org.processmining.plugins.etm.model.narytree.NAryTree applyHidingAndOperatorDowngrading(int configurationNumber)
configurationNumber
- public int countNodes(short type)
org.processmining.plugins.etm.model.narytree.NAryTree
countNodes
in interface org.processmining.plugins.etm.model.narytree.NAryTree
protected static double expectedCol(int keys, long vals)
public int hashCode(int node)
public void removeAllConfigurations()
removeAllConfigurations
in interface org.processmining.plugins.etm.model.narytree.NAryTree
public org.processmining.plugins.etm.model.narytree.NAryTree addParent(int node, short type, byte configurationType)
org.processmining.plugins.etm.model.narytree.NAryTree
addParent
in interface org.processmining.plugins.etm.model.narytree.NAryTree
node
- a node in the tree that gets a new parent (can be any node)type
- the type of the new parent (cannot be LOOP, TAU or any leaf
type)