Class DfgImpl

  • All Implemented Interfaces:
    java.lang.Cloneable, Dfg, NormalisedIntDfg

    public class DfgImpl
    extends java.lang.Object
    implements Dfg
    • Constructor Detail

      • DfgImpl

        public DfgImpl()
      • DfgImpl

        public DfgImpl​(int initialSize)
    • Method Detail

      • createTimeOptimised

        public static DfgImpl createTimeOptimised​(int initialSize)
      • addActivity

        public int addActivity​(org.deckfour.xes.classification.XEventClass activity)
        Description copied from interface: Dfg
        Adds an activity to the Dfg.
        Specified by:
        addActivity in interface Dfg
        Returns:
        The index of the inserted activity.
      • getActivities

        public org.deckfour.xes.classification.XEventClass[] getActivities()
        Specified by:
        getActivities in interface Dfg
        Returns:
        An array of the activities. Do not edit this array.
      • getActivityIndices

        public int[] getActivityIndices()
        Specified by:
        getActivityIndices in interface Dfg
      • addDirectlyFollowsEdge

        public void addDirectlyFollowsEdge​(org.deckfour.xes.classification.XEventClass source,
                                           org.deckfour.xes.classification.XEventClass target,
                                           long cardinality)
        Specified by:
        addDirectlyFollowsEdge in interface Dfg
      • addParallelEdge

        public void addParallelEdge​(org.deckfour.xes.classification.XEventClass a,
                                    org.deckfour.xes.classification.XEventClass b,
                                    long cardinality)
        Specified by:
        addParallelEdge in interface Dfg
      • addStartActivity

        public void addStartActivity​(org.deckfour.xes.classification.XEventClass activity,
                                     long cardinality)
        Specified by:
        addStartActivity in interface Dfg
      • addEndActivity

        public void addEndActivity​(org.deckfour.xes.classification.XEventClass activity,
                                   long cardinality)
        Specified by:
        addEndActivity in interface Dfg
      • toString

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

        public Dfg clone()
        Specified by:
        clone in interface Dfg
        Specified by:
        clone in interface NormalisedIntDfg
        Overrides:
        clone in class java.lang.Object
        Returns:
        An unconnected copy of the Dfg.
      • getIndexOfActivity

        public int getIndexOfActivity​(org.deckfour.xes.classification.XEventClass activity)
        Specified by:
        getIndexOfActivity in interface Dfg
        Returns:
        The index of the given activity, or -1 if it does not exist.
      • getActivityOfIndex

        public org.deckfour.xes.classification.XEventClass getActivityOfIndex​(int activityIndex)
        Specified by:
        getActivityOfIndex in interface Dfg
        Returns:
        The activity of the given index.
      • isStartActivity

        public boolean isStartActivity​(int activityIndex)
        Specified by:
        isStartActivity in interface NormalisedIntDfg
        Returns:
        Whether the activity with the given index is a start activity.
      • isStartActivity

        public boolean isStartActivity​(org.deckfour.xes.classification.XEventClass activity)
        Specified by:
        isStartActivity in interface Dfg
        Returns:
        Whether the activity is a start activity. If possible, use the integer-variant.
      • getStartActivityCardinality

        public long getStartActivityCardinality​(int activityIndex)
        Specified by:
        getStartActivityCardinality in interface NormalisedIntDfg
        Returns:
        How often the activity was a start activity.
      • getStartActivityCardinality

        public long getStartActivityCardinality​(org.deckfour.xes.classification.XEventClass activity)
        Specified by:
        getStartActivityCardinality in interface Dfg
        Returns:
        How often the activity was a start activity. Use the integer variant if possible.
      • getEndActivityCardinality

        public long getEndActivityCardinality​(int activityIndex)
        Specified by:
        getEndActivityCardinality in interface NormalisedIntDfg
        Returns:
        How often the activity was an end activity.
      • getEndActivityCardinality

        public long getEndActivityCardinality​(org.deckfour.xes.classification.XEventClass activity)
        Specified by:
        getEndActivityCardinality in interface Dfg
        Returns:
        How often the activity was an end activity. Use the integer variant if possible.
      • isEndActivity

        public boolean isEndActivity​(int activityIndex)
        Specified by:
        isEndActivity in interface NormalisedIntDfg
        Returns:
        Whether the activity with the given index is a end activity.
      • isEndActivity

        public boolean isEndActivity​(org.deckfour.xes.classification.XEventClass activity)
        Specified by:
        isEndActivity in interface Dfg
        Returns:
        Whether the activity is a end activity. If possible, use the integer-variant.
      • getMostOccurringEndActivityCardinality

        public long getMostOccurringEndActivityCardinality()
        Specified by:
        getMostOccurringEndActivityCardinality in interface NormalisedIntDfg
        Returns:
        The number of occurrences of the activity that occurs the most as an end activity.
      • getDirectlyFollowsEdges

        public java.lang.Iterable<java.lang.Long> getDirectlyFollowsEdges()
        Description copied from interface: NormalisedIntDfg
        Returns an iterable that iterates over all edges; The edges that are returned are indices. Edges of weight 0 are excluded.
        Specified by:
        getDirectlyFollowsEdges in interface NormalisedIntDfg
        Returns:
      • containsDirectlyFollowsEdge

        public boolean containsDirectlyFollowsEdge​(org.deckfour.xes.classification.XEventClass source,
                                                   org.deckfour.xes.classification.XEventClass target)
        Specified by:
        containsDirectlyFollowsEdge in interface Dfg
      • getDirectlyFollowsEdgeSource

        public org.deckfour.xes.classification.XEventClass getDirectlyFollowsEdgeSource​(long edgeIndex)
        Specified by:
        getDirectlyFollowsEdgeSource in interface Dfg
      • getDirectlyFollowsEdgeTarget

        public org.deckfour.xes.classification.XEventClass getDirectlyFollowsEdgeTarget​(long edgeIndex)
        Specified by:
        getDirectlyFollowsEdgeTarget in interface Dfg
      • getConcurrencyEdges

        public java.lang.Iterable<java.lang.Long> getConcurrencyEdges()
        Description copied from interface: NormalisedIntDfg
        Returns an iterable that iterates over all edges; The edges that are returned are indices. Edges of weight 0 are excluded.
        Specified by:
        getConcurrencyEdges in interface NormalisedIntDfg
        Returns:
      • containsConcurrencyEdge

        public boolean containsConcurrencyEdge​(org.deckfour.xes.classification.XEventClass source,
                                               org.deckfour.xes.classification.XEventClass target)
        Specified by:
        containsConcurrencyEdge in interface Dfg
      • getConcurrencyEdgeSource

        public org.deckfour.xes.classification.XEventClass getConcurrencyEdgeSource​(long edgeIndex)
        Specified by:
        getConcurrencyEdgeSource in interface Dfg
      • getConcurrencyEdgeTarget

        public org.deckfour.xes.classification.XEventClass getConcurrencyEdgeTarget​(long edgeIndex)
        Specified by:
        getConcurrencyEdgeTarget in interface Dfg
      • addStartActivities

        public void addStartActivities​(MultiSet<org.deckfour.xes.classification.XEventClass> startActivities)
        Description copied from interface: Dfg
        Add the start activities in the multiset to the start activities.
        Specified by:
        addStartActivities in interface Dfg
      • addStartActivities

        public void addStartActivities​(Dfg dfg)
        Description copied from interface: Dfg
        Add the start activities in the dfg to the start activities.
        Specified by:
        addStartActivities in interface Dfg
      • removeStartActivity

        public void removeStartActivity​(org.deckfour.xes.classification.XEventClass activity)
        Description copied from interface: Dfg
        Removes the start activity. Use the integer variant if possible.
        Specified by:
        removeStartActivity in interface Dfg
      • getStartActivities

        public java.lang.Iterable<org.deckfour.xes.classification.XEventClass> getStartActivities()
        Description copied from interface: Dfg
        Return an iterable over the start activities. Use the integer variant if possible.
        Specified by:
        getStartActivities in interface Dfg
        Returns:
      • getStartActivityIndices

        public int[] getStartActivityIndices()
        Specified by:
        getStartActivityIndices in interface NormalisedIntDfg
        Returns:
        The indices of the start activities. This array should not be edited.
      • getNumberOfStartActivities

        public long getNumberOfStartActivities()
        Specified by:
        getNumberOfStartActivities in interface NormalisedIntDfg
        Returns:
        The number of times that an end activity occurred. Use getNumberOfStartActivities() for the set-size.
      • addEndActivities

        public void addEndActivities​(MultiSet<org.deckfour.xes.classification.XEventClass> endActivities)
        Description copied from interface: Dfg
        Add the end activities in the multiset to the end activities.
        Specified by:
        addEndActivities in interface Dfg
      • addEndActivities

        public void addEndActivities​(Dfg dfg)
        Description copied from interface: Dfg
        Add the end activities in the dfg to the end activities.
        Specified by:
        addEndActivities in interface Dfg
      • removeEndActivity

        public void removeEndActivity​(org.deckfour.xes.classification.XEventClass activity)
        Description copied from interface: Dfg
        Removes the end activity. Use the integer variant if possible.
        Specified by:
        removeEndActivity in interface Dfg
      • getEndActivities

        public java.lang.Iterable<org.deckfour.xes.classification.XEventClass> getEndActivities()
        Description copied from interface: Dfg
        Return an iterable over the start activities. Use the integer variant if possible.
        Specified by:
        getEndActivities in interface Dfg
        Returns:
      • getEndActivityIndices

        public int[] getEndActivityIndices()
        Specified by:
        getEndActivityIndices in interface NormalisedIntDfg
        Returns:
        The indices of the start activities. This array should not be edited.
      • getNumberOfEndActivities

        public long getNumberOfEndActivities()
        Specified by:
        getNumberOfEndActivities in interface NormalisedIntDfg
        Returns:
        The number of times that an end activity occurred. Use getNumberOfEndActivities() for the set-size.
      • addActivity

        public void addActivity​(int index)
        Description copied from interface: NormalisedIntDfg
        Add an activity. Notice that the index should be normalised.
        Specified by:
        addActivity in interface NormalisedIntDfg
      • getActivityMultiSet

        public MultiIntSet getActivityMultiSet()
      • getActivitiesIndices

        public int[] getActivitiesIndices()