Package org.processmining.lpm.util
Class NAryTreeEpisode
- java.lang.Object
-
- org.processmining.lpm.util.NAryTreeEpisode
-
- All Implemented Interfaces:
java.lang.Comparable<org.processmining.plugins.etm.model.narytree.NAryTree>,org.processmining.plugins.etm.model.narytree.NAryTree
public class NAryTreeEpisode extends java.lang.Object implements org.processmining.plugins.etm.model.narytree.NAryTreeThis class implements n-ary process trees. Trees are represented by 3 arrays. The root node has index 0 The children of node m are located at indices m+1 upto but excluding next[m]. The type of node m is stored in type[m], where a negative constant is a type for an operator node and a semi-positive value indicates a leaf. The parent of node m is stored in parent[m]- Author:
- bfvdonge
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]leafsstores the index of the next leafprotected int[]nextstores the index of the next node in the subtree under mprotected intnumConfigurationsThe current number of configurationsprotected int[]parentstored the index of the parent of a node m.protected short[]typestores the type of a node m.protected short[][]typesstores the type of a node m for each configuration.
-
Constructor Summary
Constructors Modifier Constructor Description protectedNAryTreeEpisode(int size)NAryTreeEpisode(int[] next, short[] type, int[] parent)NAryTreeEpisode(gnu.trove.list.TIntList next, gnu.trove.list.TShortList type, gnu.trove.list.TIntList 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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NAryTreeEpisodeadd(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.NAryTreeaddChild(int operatorNode, int location, short leafType, byte configurationType)Returns a new tree in which a child is added to the operator at the given indexvoidaddConfiguration(org.processmining.plugins.etm.model.narytree.Configuration configuration)adds the given configurations to the list of configurations.org.processmining.plugins.etm.model.narytree.NAryTreeaddParent(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.NAryTreeEpisodeaddParent(int node, short newType, short newType2)org.processmining.plugins.etm.model.narytree.NAryTreeapplyConfiguration(int configurationNumber)Applies a configuration to the tree and returns the result.org.processmining.plugins.etm.model.narytree.NAryTreeapplyHidingAndOperatorDowngrading(int configurationNumber)Apply all hiding and downgrading configurations of the provided configuration number.intcompareTo(org.processmining.plugins.etm.model.narytree.NAryTree o)intcountNodes(short type)counts the number of nodes of the given typebooleanequals(java.lang.Object o)returns true if all four internal arrays are identical.protected static doubleexpectedCol(int keys, long vals)intfindBlockEffect(int blockedNode)Finds the effect of blocking a particular node.intgetChildAtIndex(int par, int n)returns the id of the n-th child of par.org.processmining.plugins.etm.model.narytree.ConfigurationgetConfiguration(int configurationNumber)Returns the configuration stored at the given index.protected intgetHighestParentWithOneChild(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.intgetNext(int node)returns the first node not in the subtree of the given node .intgetNextFast(int node)returns the first node larger than the given node, which is not part of the subtree of the given node.intgetNextLeaf(int node)returns the leaf greater than the given node.intgetNextLeafFast(int node)returns the leaf greater than the given node.bytegetNodeConfiguration(int configurationNumber, int node)returns the configuration of the node in the given configuration.bytegetNodeConfigurationFast(int configurationNumber, int node)intgetNumberOfConfigurations()Returns the number of configurations.intgetParent(int node)returns the parent of the given node.intgetParentFast(int node)returns the parent of the given node.shortgetType(int node)returns the type of a node.shortgetType(int configurationNumber, int node)returns the type of a node.shortgetTypeFast(int node)returns the type of a node.shortgetTypeFast(int configurationNumber, int node)returns the type of a node.inthashCode()returns hashcode based on the internal arraysinthashCode(int node)booleanisBlocked(int configurationNumber, int node)returns true if the given node is blocked in the given configurationbooleanisConsistent()returns true if the tree is (internally) consistentbooleanisDowngraded(int configurationNumber, int node)booleanisHidden(int configurationNumber, int node)returns true if the given node is hidden in the given configurationbooleanisInSubtree(int par, int child)returns if the child appears in the subtree of the parentbooleanisLeaf(int node)returns true if a node is a leaf.org.processmining.plugins.etm.model.narytree.NAryTreemove(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.NAryTreemove(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.intnChildren(int node)returns the number of children of a node.intnumLeafs()returns the number of leafs in the tree.org.processmining.plugins.etm.model.narytree.NAryTreeremove(int node)removes the node at index node from the treorg.processmining.plugins.etm.model.narytree.NAryTreeremove(int par, int index)removes the child at index from node par.voidremoveAllConfigurations()voidremoveConfiguration(int configurationNumber)Removes the configuration at the given index from the list of configurations.org.processmining.plugins.etm.model.narytree.NAryTreereplace(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.NAryTreeEpisodereplace(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 voidset(int index, short typeVal, int parentVal, int nextVal)Sets the values of the internal arrays according to the given parameters.voidsetNodeConfiguration(int configurationNumber, int node, byte configurationOption)Sets the configuration option for a node.voidsetType(int par, int n, short t)sets the type of the n-th child of parent par.voidsetType(int index, short t)Sets the type of the node.intsize()returns the number of nodes in the treeintsize(int node)returns the size of the subtree under nodeNAryTreeEpisodeswap(int node1, int node2)returns a new tree with the two nodes swapped.java.lang.StringtoInternalString()returns a string representation of the internal datastructures of the tree (for debugging only)java.lang.StringtoString()
-
-
-
Field Detail
-
numConfigurations
protected int numConfigurations
The current number of configurations
-
next
protected final int[] next
stores the index of the next node in the subtree under m
-
type
protected final short[] type
stores the type of a node m. If the value is negative, it is one of the given constants AND, OR, XOR, LOOP. If the value if semi-positive a leaf is implied
-
types
protected short[][] types
stores the type of a node m for each configuration. If the value is negative, it is one of the given constants AND, OR, XOR, LOOP. If the value if semi-positive a leaf is implied
-
parent
protected final int[] parent
stored the index of the parent of a node m. parent[0]=NONE and for all other elements m, parent[m]>=0
-
leafs
protected final int[] leafs
stores the index of the next leaf
-
-
Constructor Detail
-
NAryTreeEpisode
public NAryTreeEpisode(org.processmining.plugins.etm.model.narytree.NAryTree original)
-
NAryTreeEpisode
public NAryTreeEpisode(int[] next, short[] type, int[] parent)
-
NAryTreeEpisode
protected NAryTreeEpisode(int size)
-
NAryTreeEpisode
public NAryTreeEpisode(gnu.trove.list.TIntList next, gnu.trove.list.TShortList type, gnu.trove.list.TIntList parent)
-
NAryTreeEpisode
public NAryTreeEpisode(java.util.List<java.lang.Integer> next, java.util.List<java.lang.Short> type, java.util.List<java.lang.Integer> parent)
-
-
Method Detail
-
isConsistent
public boolean isConsistent()
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns true if the tree is (internally) consistent- Specified by:
isConsistentin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Returns:
-
set
protected void set(int index, short typeVal, int parentVal, int nextVal)Sets the values of the internal arrays according to the given parameters.- Parameters:
index-values-
-
setType
public void setType(int index, short t)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreeSets the type of the node. A semi-positive type indicates a leaf, a negative type should be one of the constants SEQ, REVSEQ LOOP, OR, XOR, AND- Specified by:
setTypein interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
index- Index of the node to updatet- Type to set the node to
-
setType
public void setType(int par, int n, short t)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreesets the type of the n-th child of parent par. A semi-positive type indicates a leaf, a negative type should be one of the constants SEQ, LOOP, OR, XOR, AND- Specified by:
setTypein interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
par- the parent. This should not be a leaf.n- the child number
-
swap
public NAryTreeEpisode swap(int node1, int node2)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns a new tree with the two nodes swapped. The two nodes should not be in a hierarchical relationship- Specified by:
swapin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node1- First node to swapnode2- Other node to swap with- Returns:
- NAryTree clone with this operation applied
-
add
public NAryTreeEpisode add(org.processmining.plugins.etm.model.narytree.NAryTree source, int node, int par, int location)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreeReturns 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. If index =0, then the new subtree becomes the leftmost branch of the new parent. If index > the number of children then it becomes the rightmost child The parent node cannot be a loop or a leaf It is assumed that this tree and the given tree have an equal number of configurations. The configuration options set per node are copied from the source trees.- Specified by:
addin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
source- NAryTree to add a node fromnode- Node to add from the source tree to the current tree- Returns:
- NAryTree clone with this operation applied
-
addParent
public NAryTreeEpisode addParent(int node, short newType, short newType2)
-
addChild
public org.processmining.plugins.etm.model.narytree.NAryTree addChild(int operatorNode, int location, short leafType, byte configurationType)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreeReturns a new tree in which a child is added to the operator at the given index- Specified by:
addChildin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
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 inserted- Returns:
- NAryTree clone with this operation applied
-
replace
public org.processmining.plugins.etm.model.narytree.NAryTree replace(int par, int n, org.processmining.plugins.etm.model.narytree.NAryTree source, int node)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereplaces the n-th child of parent with the node from source. It is assumed that this tree and the given tree have an equal number of configurations. The configuration options set per node are copied from the source trees.- Specified by:
replacein interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
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 tree- Returns:
- NAryTree clone with this operation applied
-
replace
public NAryTreeEpisode replace(int node, org.processmining.plugins.etm.model.narytree.NAryTree source, int srcNode)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereplaces 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. The configuration options set per node are copied from the source trees.- Specified by:
replacein interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
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 tree- Returns:
- NAryTree clone with this operation applied
-
remove
public org.processmining.plugins.etm.model.narytree.NAryTree remove(int par, int index)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreeremoves the child at index from node par. if index >= nChildren(parent) then the right-most child is removed. If parent is a leaf, then nothing is removed and a clone is returned;- Specified by:
removein interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
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 removed- Returns:
- NAryTree clone with this operation applied
-
remove
public org.processmining.plugins.etm.model.narytree.NAryTree remove(int node)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreeremoves the node at index node from the tre- Specified by:
removein interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node- Index of the node to be removed- Returns:
- NAryTree clone with this operation applied
-
move
public org.processmining.plugins.etm.model.narytree.NAryTree move(int node, int newParent, int location)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreemoves the given node by removing it from its parent and adding is under the new parent. The node should not be the root and both the existing and new parent should not be loops.- Specified by:
movein interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node- Node to be (re)movednewParent- Index of the new parentlocation- Child index of the moved node in the parent node- Returns:
- NAryTree clone with this operation applied
-
move
public org.processmining.plugins.etm.model.narytree.NAryTree move(int par, int n, int newParent, int location)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreemoves the n-th child of the parent "par" by removing it from the tree and inserting it as a new child under newParent. Both the existing and new parent should not be loops.- Specified by:
movein interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
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 node- Returns:
- NAryTree clone with this operation applied
-
getType
public short getType(int node)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the type of a node.- Specified by:
getTypein interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node- Index of the node to get the type for- Returns:
- short Node type
-
getTypeFast
public short getTypeFast(int node)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the type of a node. (without sanity checks, e.g. might result in exceptions)- Specified by:
getTypeFastin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node- Index of the node to get the type for- Returns:
- short Node type
-
getChildAtIndex
public int getChildAtIndex(int par, int n)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the id of the n-th child of par. if n ==0 then the leftmost child is returned, if n>= the number of children the rightmost child is returned.- Specified by:
getChildAtIndexin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
par- a non-leaf node from which the index of the n-th child to get fromn- -th child to return index for- Returns:
- int Index of that child
-
size
public int size(int node)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the size of the subtree under node- Specified by:
sizein interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node- Index of the node to get the size for- Returns:
- Number of nodes under the given node, including that node
-
nChildren
public int nChildren(int node)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the number of children of a node.- Specified by:
nChildrenin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node- Index of the node to get the number of children for- Returns:
- Number of children
-
isInSubtree
public boolean isInSubtree(int par, int child)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns if the child appears in the subtree of the parent- Specified by:
isInSubtreein interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
par- Index of the parent node (/root of subtree) to searchchild- Index (absolute) of the child node to search for- Returns:
- boolean TRUE if child is in subtree of (uber)parent
-
equals
public boolean equals(java.lang.Object o)
returns true if all four internal arrays are identical.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
returns hashcode based on the internal arrays- Overrides:
hashCodein classjava.lang.Object
-
getHighestParentWithOneChild
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.- Parameters:
node-- Returns:
-
isLeaf
public boolean isLeaf(int node)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns true if a node is a leaf.- Specified by:
isLeafin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node- Index of the node to check- Returns:
- boolean TRUE if given node is of type leaf
-
size
public int size()
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the number of nodes in the tree- Specified by:
sizein interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Returns:
- Size of the whole tree
-
toInternalString
public java.lang.String toInternalString()
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns a string representation of the internal datastructures of the tree (for debugging only)- Specified by:
toInternalStringin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getParent
public int getParent(int node)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the parent of the given node. If the node is the root, or not in the tree, then NONE is returned- Specified by:
getParentin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node- Index of the node to get the parent for- Returns:
- index of the parent of given node
-
getParentFast
public int getParentFast(int node)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the parent of the given node. If the node is the root, or not in the tree, then NONE is returned. Fast means not sanity checks e.g. exceptions may occur- Specified by:
getParentFastin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node- Index of the node to get the parent for- Returns:
- index of parent node
-
getNext
public int getNext(int node)
returns the first node not in the subtree of the given node .- Specified by:
getNextin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node-- Returns:
-
getNextFast
public int getNextFast(int node)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the first node larger than the given node, which is not part of the subtree of the given node. May return size() if no such node exists.. Fast means no sanity checks e.g. exceptions may occur- Specified by:
getNextFastin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node- Index of the node to get the next node outside this subtree for- Returns:
- Index of next node outside of subtree.
-
numLeafs
public int numLeafs()
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the number of leafs in the tree.- Specified by:
numLeafsin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Returns:
- Number of leafs in the tree
-
compareTo
public int compareTo(org.processmining.plugins.etm.model.narytree.NAryTree o)
- Specified by:
compareToin interfacejava.lang.Comparable<org.processmining.plugins.etm.model.narytree.NAryTree>
-
getNextLeaf
public int getNextLeaf(int node)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the leaf greater than the given node. May return size() if no such leaf exists- Specified by:
getNextLeafin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node- Index of the node to get the next leaf for- Returns:
- Index of next leaf
-
getNextLeafFast
public int getNextLeafFast(int node)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the leaf greater than the given node. May return size() if no such leaf exists. Fast means no sanity checks e.g. exceptions may occur- Specified by:
getNextLeafFastin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
node- Index of the node to get the next leaf for- Returns:
- Index of next leaf
-
addConfiguration
public void addConfiguration(org.processmining.plugins.etm.model.narytree.Configuration configuration)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreeadds the given configurations to the list of configurations.- Specified by:
addConfigurationin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree
-
removeConfiguration
public void removeConfiguration(int configurationNumber)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreeRemoves the configuration at the given index from the list of configurations.- Specified by:
removeConfigurationin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree
-
getNumberOfConfigurations
public int getNumberOfConfigurations()
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreeReturns the number of configurations.- Specified by:
getNumberOfConfigurationsin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Returns:
-
getConfiguration
public org.processmining.plugins.etm.model.narytree.Configuration getConfiguration(int configurationNumber)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreeReturns the configuration stored at the given index.- Specified by:
getConfigurationin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Returns:
-
isBlocked
public boolean isBlocked(int configurationNumber, int node)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns true if the given node is blocked in the given configuration- Specified by:
isBlockedin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Returns:
-
isHidden
public boolean isHidden(int configurationNumber, int node)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns true if the given node is hidden in the given configuration- Specified by:
isHiddenin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Returns:
-
isDowngraded
public boolean isDowngraded(int configurationNumber, int node)
-
setNodeConfiguration
public void setNodeConfiguration(int configurationNumber, int node, byte configurationOption)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreeSets the configuration option for a node. Should be either of the constants BLOCKED, HIDDEN or NOTCONFIGURABLE- Specified by:
setNodeConfigurationin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree
-
getNodeConfigurationFast
public byte getNodeConfigurationFast(int configurationNumber, int node)
-
getNodeConfiguration
public byte getNodeConfiguration(int configurationNumber, int node)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the configuration of the node in the given configuration. Returns one of the constants BLOCKED, HIDDEN or NOTCONFIGURABLE- Specified by:
getNodeConfigurationin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Returns:
-
getType
public short getType(int configurationNumber, int node)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the type of a node.- Specified by:
getTypein interfaceorg.processmining.plugins.etm.model.narytree.NAryTreenode- Index of the node to get the type for- Returns:
- short Node type
-
getTypeFast
public short getTypeFast(int configurationNumber, int node)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreereturns the type of a node. (without sanity checks, e.g. might result in exceptions)- Specified by:
getTypeFastin interfaceorg.processmining.plugins.etm.model.narytree.NAryTreenode- Index of the node to get the type for- Returns:
- short Node type
-
applyConfiguration
public org.processmining.plugins.etm.model.narytree.NAryTree applyConfiguration(int configurationNumber)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreeApplies a configuration to the tree and returns the result. The applied configuration should not result in deadlock, i.e. no blocking under SEQ, REVSEQ, AND nodes or as a non-middle child of a LOOP. Not all children of a node may be blocked (at least one is not blocked) Any blocked subtree is completely removed from the tree Any hidden subtree is replaced by a tau- Specified by:
applyConfigurationin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Returns:
-
findBlockEffect
public int findBlockEffect(int blockedNode)
Finds the effect of blocking a particular node. If a child of a SEQ or AND operator is blocked then the operator itself is blocked. The same for DO and EXIT children of a LOOP operator. Also, if the only (remaining) child of an operator is blocked, the operator itself is also blocked.- Specified by:
findBlockEffectin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
blockedNode- the node that is know to be blocked- Returns:
- the ID of the node that is also blocked as an effect of the block of the provided node. If there is no cascading effect than the blockedNode is returned.
-
applyHidingAndOperatorDowngrading
public org.processmining.plugins.etm.model.narytree.NAryTree applyHidingAndOperatorDowngrading(int configurationNumber)
Apply all hiding and downgrading configurations of the provided configuration number. ERGO: blocking is not applied! applyConfiguration is the preferred method to apply configurations!!! This method only applies particular configuration options!!!- Parameters:
configurationNumber-- Returns:
-
countNodes
public int countNodes(short type)
Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreecounts the number of nodes of the given type- Specified by:
countNodesin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Returns:
-
expectedCol
protected static double expectedCol(int keys, long vals)
-
hashCode
public int hashCode(int node)
-
removeAllConfigurations
public void removeAllConfigurations()
- Specified by:
removeAllConfigurationsin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree
-
addParent
public org.processmining.plugins.etm.model.narytree.NAryTree addParent(int node, short type, byte configurationType)Description copied from interface:org.processmining.plugins.etm.model.narytree.NAryTreeReturns 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.- Specified by:
addParentin interfaceorg.processmining.plugins.etm.model.narytree.NAryTree- Parameters:
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)- Returns:
- NAryTree clone with this operation applied
-
-