Class DirectlyFollowsModelImplQuadratic
- java.lang.Object
-
- org.processmining.directlyfollowsmodelminer.model.DirectlyFollowsModelImplQuadratic
-
- All Implemented Interfaces:
DirectlyFollowsModel
public class DirectlyFollowsModelImplQuadratic extends java.lang.Object implements DirectlyFollowsModel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDirectlyFollowsModelImplQuadratic.EdgeIterator
-
Constructor Summary
Constructors Constructor Description DirectlyFollowsModelImplQuadratic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdge(int sourceIndex, int targetIndex)Adds an edge.voidaddEndNode(int activity)Has no effect if the activity was already an end node.intaddNode(java.lang.String activity)Inserts an activity.voidaddNodes(java.lang.String[] activities)Adds an array of nodes with the provided names.voidaddStartNode(int activity)Has no effect if the activity was already a start node.DirectlyFollowsModelclone()booleancontainsEdge(int sourceIndex, int targetIndex)Returns whether the graph contains an edge between source and target.booleanequals(DirectlyFollowsModel other)This method considers graphs equal when they are the same and the activities were added in the same order.java.lang.String[]getAllNodeNames()java.lang.Iterable<java.lang.Long>getEdges()Gives an iterable that iterates over all edges; The edges that are returned are indices.intgetEdgeSource(long edgeIndex)Returns the node the edgeIndex comes from.intgetEdgeTarget(long edgeIndex)Returns the node the edgeIndex points to.gnu.trove.set.TIntSetgetEndNodes()gnu.trove.set.TIntSetgetIndicesOfNodeName(java.lang.String activity)java.lang.Iterable<java.lang.Integer>getNodeIndices()java.lang.StringgetNodeOfIndex(int value)intgetNumberOfEndNodes()intgetNumberOfNodes()intgetNumberOfStartNodes()gnu.trove.set.TIntSetgetStartNodes()booleanhasEndNodes()booleanhasStartNodes()booleanisEmptyTraces()voidremoveEdge(int sourceIndex, int targetIndex)Removes an edge.voidsetEmptyTraces(boolean emptyTraces)Set whether the model supports empty (epsilon) traces.-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.processmining.directlyfollowsmodelminer.model.DirectlyFollowsModel
hashCode
-
-
-
-
Method Detail
-
getNodeOfIndex
public java.lang.String getNodeOfIndex(int value)
- Specified by:
getNodeOfIndexin interfaceDirectlyFollowsModel- Returns:
- The activity, or null if it does not exist.
-
getNumberOfNodes
public int getNumberOfNodes()
- Specified by:
getNumberOfNodesin interfaceDirectlyFollowsModel- Returns:
- The number of nodes in the model.
-
getAllNodeNames
public java.lang.String[] getAllNodeNames()
- Specified by:
getAllNodeNamesin interfaceDirectlyFollowsModel- Returns:
- The added node names, in the order they were added.
-
getNodeIndices
public java.lang.Iterable<java.lang.Integer> getNodeIndices()
- Specified by:
getNodeIndicesin interfaceDirectlyFollowsModel
-
getIndicesOfNodeName
public gnu.trove.set.TIntSet getIndicesOfNodeName(java.lang.String activity)
- Specified by:
getIndicesOfNodeNamein interfaceDirectlyFollowsModel- Returns:
- The indices of the nodeName.
-
addNode
public int addNode(java.lang.String activity)
Description copied from interface:DirectlyFollowsModelInserts an activity.- Specified by:
addNodein interfaceDirectlyFollowsModel- Returns:
- the index of the newly added node.
-
addNodes
public void addNodes(java.lang.String[] activities)
Description copied from interface:DirectlyFollowsModelAdds an array of nodes with the provided names. Typically more efficient than adding the nodes one-by-one.- Specified by:
addNodesin interfaceDirectlyFollowsModel
-
isEmptyTraces
public boolean isEmptyTraces()
- Specified by:
isEmptyTracesin interfaceDirectlyFollowsModel- Returns:
- Whether the model supports empty (epsilon) traces.
-
setEmptyTraces
public void setEmptyTraces(boolean emptyTraces)
Description copied from interface:DirectlyFollowsModelSet whether the model supports empty (epsilon) traces.- Specified by:
setEmptyTracesin interfaceDirectlyFollowsModel
-
addEdge
public void addEdge(int sourceIndex, int targetIndex)Description copied from interface:DirectlyFollowsModelAdds an edge. Has no effect if the edge was already present.- Specified by:
addEdgein interfaceDirectlyFollowsModel
-
removeEdge
public void removeEdge(int sourceIndex, int targetIndex)Description copied from interface:DirectlyFollowsModelRemoves an edge. Has no effect if the edge was not present.- Specified by:
removeEdgein interfaceDirectlyFollowsModel
-
getEdges
public java.lang.Iterable<java.lang.Long> getEdges()
Description copied from interface:DirectlyFollowsModelGives an iterable that iterates over all edges; The edges that are returned are indices. The iterable supports remove() calls, however calls to this method might invalidate other iterables.- Specified by:
getEdgesin interfaceDirectlyFollowsModel- Returns:
-
containsEdge
public boolean containsEdge(int sourceIndex, int targetIndex)Description copied from interface:DirectlyFollowsModelReturns whether the graph contains an edge between source and target.- Specified by:
containsEdgein interfaceDirectlyFollowsModel- Returns:
-
getEdgeSource
public int getEdgeSource(long edgeIndex)
Description copied from interface:DirectlyFollowsModelReturns the node the edgeIndex comes from.- Specified by:
getEdgeSourcein interfaceDirectlyFollowsModel- Returns:
-
getEdgeTarget
public int getEdgeTarget(long edgeIndex)
Description copied from interface:DirectlyFollowsModelReturns the node the edgeIndex points to.- Specified by:
getEdgeTargetin interfaceDirectlyFollowsModel- Returns:
-
hasStartNodes
public boolean hasStartNodes()
- Specified by:
hasStartNodesin interfaceDirectlyFollowsModel
-
getStartNodes
public gnu.trove.set.TIntSet getStartNodes()
- Specified by:
getStartNodesin interfaceDirectlyFollowsModel
-
getNumberOfStartNodes
public int getNumberOfStartNodes()
- Specified by:
getNumberOfStartNodesin interfaceDirectlyFollowsModel
-
addStartNode
public void addStartNode(int activity)
Description copied from interface:DirectlyFollowsModelHas no effect if the activity was already a start node.- Specified by:
addStartNodein interfaceDirectlyFollowsModel
-
hasEndNodes
public boolean hasEndNodes()
- Specified by:
hasEndNodesin interfaceDirectlyFollowsModel
-
getEndNodes
public gnu.trove.set.TIntSet getEndNodes()
- Specified by:
getEndNodesin interfaceDirectlyFollowsModel
-
getNumberOfEndNodes
public int getNumberOfEndNodes()
- Specified by:
getNumberOfEndNodesin interfaceDirectlyFollowsModel
-
addEndNode
public void addEndNode(int activity)
Description copied from interface:DirectlyFollowsModelHas no effect if the activity was already an end node.- Specified by:
addEndNodein interfaceDirectlyFollowsModel
-
clone
public DirectlyFollowsModel clone()
- Specified by:
clonein interfaceDirectlyFollowsModel- Overrides:
clonein classjava.lang.Object
-
equals
public boolean equals(DirectlyFollowsModel other)
Description copied from interface:DirectlyFollowsModelThis method considers graphs equal when they are the same and the activities were added in the same order.- Specified by:
equalsin interfaceDirectlyFollowsModel- Returns:
-
-