org.processmining.mining.dmcscanning
Class AdmcSet

java.lang.Object
  extended by org.processmining.mining.dmcscanning.AdmcSet

public class AdmcSet
extends java.lang.Object

Author:
Christian W. Guenther (christian at deckfour dot org)

Field Summary
protected  java.util.HashMap<java.lang.String,Admc> admcs
           
protected  java.util.ArrayList<Admc> consolidationVictims
           
protected  AggregationMethod method
           
 
Constructor Summary
AdmcSet(AggregationMethod aMethod)
          constructor
 
Method Summary
 int add(Dmc aDmc)
          Attempts to merge a DMC with all included ADMCs.
 java.util.Iterator allAdmcIterator()
           
 java.util.Iterator allInProcessInstanceIterator(java.lang.String processId, java.lang.String processInstanceId)
           
static AdmcSet buildAdmcSet(DmcSet aDmcSet, AggregationMethod aMethod, Progress progress)
          Convenience method.
 double consolidate()
          consolidates the ADMC set.
 java.util.ArrayList consolidationVictims()
           
 java.util.Iterator consolidationVictimsIterator()
           
 int consolidationVictimsSize()
           
 Admc get(Footprint footprint)
          Retrieves an ADMC according to its footprint
 Admc get(java.lang.String key)
          Retrieve an ADMC by its string id
 java.util.Collection<Admc> getAll()
           
 java.util.Collection<Admc> getAllCopy()
           
 java.util.ArrayList getAllInProcessInstance(java.lang.String processId, java.lang.String processInstanceId)
          Retrieves all ADMCs within a specific process instance
 java.util.SortedSet<Admc> getAllSorted()
           
 boolean isConsolidated()
           
 java.util.Iterator iterator()
           
 void makeConsolidationVictim(java.lang.String anAdmcId)
          Makes the specified ADMC a victim of consolidation.
 Admc remove(java.lang.String key)
          Removes the specified ADMC from the set by id key
 int size()
           
 void testOutput()
          provides the required test output in pseudo-xml format to Message.TEST
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

admcs

protected java.util.HashMap<java.lang.String,Admc> admcs

consolidationVictims

protected java.util.ArrayList<Admc> consolidationVictims

method

protected AggregationMethod method
Constructor Detail

AdmcSet

public AdmcSet(AggregationMethod aMethod)
constructor

Parameters:
aMethod - the AggregationMethod instance to be used for DMC->ADMC aggregation (comparison and merging)
Method Detail

add

public int add(Dmc aDmc)
Attempts to merge a DMC with all included ADMCs. If none succeeds, a new ADMC is being created and inserted, based on the provided DMC.

Parameters:
aDmc - the DMC to add to ADMC (set).
Returns:
the number of ADMCs the DMC was merged with. Zero, if a new ADMC was created.

get

public Admc get(java.lang.String key)
Retrieve an ADMC by its string id

Parameters:
key - id string of ADMC to retrieve
Returns:

remove

public Admc remove(java.lang.String key)
Removes the specified ADMC from the set by id key

Parameters:
key - id string of ADMC to remove
Returns:
the removed ADMC, null if not contained

get

public Admc get(Footprint footprint)
Retrieves an ADMC according to its footprint

Parameters:
footprint - the footprint to match
Returns:
the first ADMC within the set matching the specified footprint

getAll

public java.util.Collection<Admc> getAll()
Returns:
collection interface to all ADMCs contained

getAllCopy

public java.util.Collection<Admc> getAllCopy()

getAllSorted

public java.util.SortedSet<Admc> getAllSorted()
Returns:
sorted set of all ADMCs contained

iterator

public java.util.Iterator iterator()
Returns:
iterator on the set of contained ADMCs

size

public int size()
Returns:
the number of contained ADMCs

consolidate

public double consolidate()
consolidates the ADMC set. The implementation of this method is up to the specific aggregation method, the rationale behind it is to strip down a set of ADMCs to the most fundamental elements. As such, the method is expected to merge similar ADMCs together or to delete less significant elements, according to its intent and implementation.

Returns:
value within [0,1]; 0=all elements removed; 1=nothing removed

makeConsolidationVictim

public void makeConsolidationVictim(java.lang.String anAdmcId)
Makes the specified ADMC a victim of consolidation. This results in the specific ADMC no longer being part of the 'active' (or, consolidated) set of ADMCs within the ADMC set. However, it is being preserved in a list of consolidation victims that can be accessed further on.

Parameters:
anAdmcId - id string of the ADMC to victimize.

isConsolidated

public boolean isConsolidated()
Returns:
whether this set of ADMCs has already been consolidated

consolidationVictimsSize

public int consolidationVictimsSize()
Returns:
the number of ADMCs that have been victim to consolidation

consolidationVictimsIterator

public java.util.Iterator consolidationVictimsIterator()
Returns:
iterator on the set of victims of consolidation.

consolidationVictims

public java.util.ArrayList consolidationVictims()
Returns:
the set of consolidation victims (may be null, if not yet consolidated)

allAdmcIterator

public java.util.Iterator allAdmcIterator()
Returns:
an iterator on all ADMCs, both actively contained and consolidation victims

getAllInProcessInstance

public java.util.ArrayList getAllInProcessInstance(java.lang.String processId,
                                                   java.lang.String processInstanceId)
Retrieves all ADMCs within a specific process instance

Parameters:
processId - id of the process to look up
processInstanceId - id of the process instance to look up
Returns:
ArrayList containing all matching ADMCs

allInProcessInstanceIterator

public java.util.Iterator allInProcessInstanceIterator(java.lang.String processId,
                                                       java.lang.String processInstanceId)
Parameters:
processId - id of the process to look up
processInstanceId - id of the process instance to look up
Returns:
Iterator on all ADMCs within a specific process instance

testOutput

public void testOutput()
provides the required test output in pseudo-xml format to Message.TEST


buildAdmcSet

public static AdmcSet buildAdmcSet(DmcSet aDmcSet,
                                   AggregationMethod aMethod,
                                   Progress progress)
Convenience method. Builds, from a DMCSet of initially scanned DMCs together with an AggregationMethod, the set of ADMCs.

Parameters:
aDmcSet - set of initially scanned DMCs
aMethod - method to be used for ADMC aggregation
progress - the progress indicator used for status feedback
Returns:
the set of ADMCs, according to the supplied method