Class 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.NAryTree
    This 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[] 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.
      • Fields inherited from interface org.processmining.plugins.etm.model.narytree.NAryTree

        AND, ILV, LOOP, NONE, OR, REVSEQ, SEQ, TAU, XOR
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected NAryTreeEpisode​(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
      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()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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.NAryTree
        returns true if the tree is (internally) consistent
        Specified by:
        isConsistent in interface org.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.NAryTree
        Sets 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:
        setType in interface org.processmining.plugins.etm.model.narytree.NAryTree
        Parameters:
        index - Index of the node to update
        t - 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.NAryTree
        sets 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:
        setType in interface org.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.NAryTree
        returns a new tree with the two nodes swapped. The two nodes should not be in a hierarchical relationship
        Specified by:
        swap in interface org.processmining.plugins.etm.model.narytree.NAryTree
        Parameters:
        node1 - First node to swap
        node2 - 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.NAryTree
        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. 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:
        add in interface org.processmining.plugins.etm.model.narytree.NAryTree
        Parameters:
        source - NAryTree to add a node from
        node - 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.NAryTree
        Returns a new tree in which a child is added to the operator at the given index
        Specified by:
        addChild in interface org.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.NAryTree
        replaces 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:
        replace in interface org.processmining.plugins.etm.model.narytree.NAryTree
        Parameters:
        par - a node. If par is a leaf, then the parameter n is ignored
        n - 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 from
        node - 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.NAryTree
        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. The configuration options set per node are copied from the source trees.
        Specified by:
        replace in interface org.processmining.plugins.etm.model.narytree.NAryTree
        Parameters:
        node - Node in this tree to be replaced
        source - NAryTree to get the new node from
        srcNode - 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.NAryTree
        removes 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:
        remove in interface org.processmining.plugins.etm.model.narytree.NAryTree
        Parameters:
        par - the parent of the node to be removed. If par is a aleaf, a clone is returned
        index - 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.NAryTree
        removes the node at index node from the tre
        Specified by:
        remove in interface org.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.NAryTree
        moves 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:
        move in interface org.processmining.plugins.etm.model.narytree.NAryTree
        Parameters:
        node - Node to be (re)moved
        newParent - Index of the new parent
        location - 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.NAryTree
        moves 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:
        move in interface org.processmining.plugins.etm.model.narytree.NAryTree
        Parameters:
        par - Index of the parent of the node to be moved
        n - Child index of the node to be moved
        newParent - Index of the new parent of the moved node
        location - 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.NAryTree
        returns the type of a node.
        Specified by:
        getType in interface org.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.NAryTree
        returns the type of a node. (without sanity checks, e.g. might result in exceptions)
        Specified by:
        getTypeFast in interface org.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.NAryTree
        returns 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:
        getChildAtIndex in interface org.processmining.plugins.etm.model.narytree.NAryTree
        Parameters:
        par - a non-leaf node from which the index of the n-th child to get from
        n - -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.NAryTree
        returns the size of the subtree under node
        Specified by:
        size in interface org.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.NAryTree
        returns the number of children of a node.
        Specified by:
        nChildren in interface org.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.NAryTree
        returns if the child appears in the subtree of the parent
        Specified by:
        isInSubtree in interface org.processmining.plugins.etm.model.narytree.NAryTree
        Parameters:
        par - Index of the parent node (/root of subtree) to search
        child - 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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        returns hashcode based on the internal arrays
        Overrides:
        hashCode in class java.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.NAryTree
        returns true if a node is a leaf.
        Specified by:
        isLeaf in interface org.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.NAryTree
        returns the number of nodes in the tree
        Specified by:
        size in interface org.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.NAryTree
        returns a string representation of the internal datastructures of the tree (for debugging only)
        Specified by:
        toInternalString in interface org.processmining.plugins.etm.model.narytree.NAryTree
        Returns:
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getParent

        public int getParent​(int node)
        Description copied from interface: org.processmining.plugins.etm.model.narytree.NAryTree
        returns the parent of the given node. If the node is the root, or not in the tree, then NONE is returned
        Specified by:
        getParent in interface org.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.NAryTree
        returns 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:
        getParentFast in interface org.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:
        getNext in interface org.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.NAryTree
        returns 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:
        getNextFast in interface org.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.NAryTree
        returns the number of leafs in the tree.
        Specified by:
        numLeafs in interface org.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:
        compareTo in interface java.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.NAryTree
        returns the leaf greater than the given node. May return size() if no such leaf exists
        Specified by:
        getNextLeaf in interface org.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.NAryTree
        returns 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:
        getNextLeafFast in interface org.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.NAryTree
        adds the given configurations to the list of configurations.
        Specified by:
        addConfiguration in interface org.processmining.plugins.etm.model.narytree.NAryTree
      • removeConfiguration

        public void removeConfiguration​(int configurationNumber)
        Description copied from interface: org.processmining.plugins.etm.model.narytree.NAryTree
        Removes the configuration at the given index from the list of configurations.
        Specified by:
        removeConfiguration in interface org.processmining.plugins.etm.model.narytree.NAryTree
      • getNumberOfConfigurations

        public int getNumberOfConfigurations()
        Description copied from interface: org.processmining.plugins.etm.model.narytree.NAryTree
        Returns the number of configurations.
        Specified by:
        getNumberOfConfigurations in interface org.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.NAryTree
        Returns the configuration stored at the given index.
        Specified by:
        getConfiguration in interface org.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.NAryTree
        returns true if the given node is blocked in the given configuration
        Specified by:
        isBlocked in interface org.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.NAryTree
        returns true if the given node is hidden in the given configuration
        Specified by:
        isHidden in interface org.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.NAryTree
        Sets the configuration option for a node. Should be either of the constants BLOCKED, HIDDEN or NOTCONFIGURABLE
        Specified by:
        setNodeConfiguration in interface org.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.NAryTree
        returns the configuration of the node in the given configuration. Returns one of the constants BLOCKED, HIDDEN or NOTCONFIGURABLE
        Specified by:
        getNodeConfiguration in interface org.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.NAryTree
        returns the type of a node.
        Specified by:
        getType in interface org.processmining.plugins.etm.model.narytree.NAryTree
        node - 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.NAryTree
        returns the type of a node. (without sanity checks, e.g. might result in exceptions)
        Specified by:
        getTypeFast in interface org.processmining.plugins.etm.model.narytree.NAryTree
        node - 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.NAryTree
        Applies 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:
        applyConfiguration in interface org.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:
        findBlockEffect in interface org.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.NAryTree
        counts the number of nodes of the given type
        Specified by:
        countNodes in interface org.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:
        removeAllConfigurations in interface org.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.NAryTree
        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.
        Specified by:
        addParent in interface org.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