org.processmining.models.heuristics
Interface HeuristicsNet

All Known Implementing Classes:
AnnotatedHeuristicsNet, HeuristicsNetImpl, SimpleHeuristicsNet

public interface HeuristicsNet

Common interface of the HeuristicNet objects. These objects are used in algorithms like the Genetic Miner etc.

Author:
Ana Karla Alves de Medeiros

Method Summary
 int compareTo(HeuristicsNet otherHeuristicsNet)
          Compares other HeuristicsNet object with this HeuristicsNet object.
 HeuristicsNet copy()
          Makes a copy (deep clone) of this HeuristicsNet object.
 void disconnectArcsUsedBelowThreshold(double threshold)
          Removes from this HeuristicsNet object all the arcs that have not been used up to a given threshold.
 void disconnectUnusedElements()
          Disconnects in this HeuristicsNet object the activities and arcs that are not used during the parsing of an event log.
 boolean equals(java.lang.Object other)
          Checks if a given HeuristicsNet object is equal to this HeuristicsNet object.
 int[] getActivitiesActualFiring()
          Retrieves the variable that keeps track of how often activities have been executed (or fired) during the parsing of a log.
 int[] getActivitiesActualFiring(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap, int newSize)
           
 ActivitiesMappingStructures getActivitiesMappingStructures()
          Retrieves the current ActivitiesMappingStructures that is used by this HeuristicsNet object.
 HNSubSet getAllElementsInputSet(int index)
          Retrieves a set containing all the input activities of a given activity.
 HNSubSet getAllElementsOutputSet(int index)
          Retrieves a set containing all the output activities of a given activity.
 cern.colt.matrix.DoubleMatrix2D getArcUsage()
          Retrieves the variable that keeps track of how often arcs have been used during the parsing of a log.
 cern.colt.matrix.DoubleMatrix2D getArcUsage(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap, int newSize)
           
 HNSubSet getEndActivities()
          Retrieves the current set of end activities for this HeuristicsNet object.
 HNSubSet getEndActivities(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap)
           
 double getFitness()
          Retrieves the current fitness of this HeuristicsNet object.
 HNSet getInputSet(int index)
          Retrieves the input set of a given activity in this HeuristicsNet object.
 HNSet[] getInputSets()
          Retrieves the array that contains all the input sets of the activities for this HeuristicsNet object.
 HNSet getInputSetsWithElement(int index, int element)
          Retrieves subsets from an input set of an activity.
 HNSet getOutputSet(int index)
          Retrieves the output set of a given activity in this HeuristicsNet object.
 HNSet[] getOutputSets()
          Retrieves the array that contains all the output sets of the activities for this HeuristicsNet object.
 HNSet getOutputSetsWithElement(int index, int element)
          Retrieves subsets from an output set of an activity.
 HNSubSet getStartActivities()
          Retrieves the current set of start activities for this HeuristicsNet object.
 HNSubSet getStartActivities(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap)
           
 int hashCode()
          Computes the hashCode for this HeuristicsNet.
 void increaseArcUsage(int activity, HNSubSet usedInputActivities, int amount)
          Increases arc usage in this HeuristicsNet object.
 void increaseElementActualFiring(int activity, int amount)
          Increases by the specified amount the number of times an activity has fired.
 void resetActivitiesActualFiring()
          Resets the variable that keeps track of activities that are actually fired during the parsing of a log.
 void resetArcUsage()
          Resets the variable that keeps track of how often arcs are actually used during the parsing of a log by this HeuristicsNet.
In this case, all arc usages are set to 0.
 boolean setActivitiesActualFiring(int[] newActivitiesActualFiring)
          Sets the variable that keeps track of how often activities have been executed during the parsing of a log by this HeuristicsNet.
 boolean setActivitiesMappingStructures(ActivitiesMappingStructures newActivitiesMappingStructures)
          Replaces the current ActivitiesMappingStructures that is used by this HeuristicsNet object.
 boolean setArcUsage(cern.colt.matrix.DoubleMatrix2D newArcUsage)
          Sets the variable that keeps track of how often arcs are actually used during the parsing of a log by this HeuristicsNet.
 void setEndActivities(HNSubSet activities)
          Sets the end activities of this HeuristicsNet object.
 void setFitness(double newFitnessValue)
          Sets the fitness value of this HeuristicsNet object.
 boolean setInputSet(int index, HNSet sets)
          Sets the input sets of a given activity in this HeuristicsNet object.
 boolean setOutputSet(int index, HNSet sets)
          Sets the output sets of a given activity in this HeuristicsNet object.
 void setStartActivities(HNSubSet activities)
          Sets the start activities of this HeuristicsNet object.
 int size()
          Retrieves the number of activities in this HeuristicsNet object.
 java.lang.String toString()
          Creates a string representation of this HeuristicsNet object.
 

Method Detail

resetActivitiesActualFiring

void resetActivitiesActualFiring()
Resets the variable that keeps track of activities that are actually fired during the parsing of a log. The activities that do not fire are not shown in the graphical representation of the HeuristicsNet.
In this case, all activities have their counters set to 0.


resetArcUsage

void resetArcUsage()
Resets the variable that keeps track of how often arcs are actually used during the parsing of a log by this HeuristicsNet.
In this case, all arc usages are set to 0.


getActivitiesActualFiring

int[] getActivitiesActualFiring()
Retrieves the variable that keeps track of how often activities have been executed (or fired) during the parsing of a log.

Returns:
An array containing the number of times that a given activity has fired.

getArcUsage

cern.colt.matrix.DoubleMatrix2D getArcUsage()
Retrieves the variable that keeps track of how often arcs have been used during the parsing of a log.

Returns:
A matrix containing the number of times that a given arc has been used.

setActivitiesActualFiring

boolean setActivitiesActualFiring(int[] newActivitiesActualFiring)
Sets the variable that keeps track of how often activities have been executed during the parsing of a log by this HeuristicsNet.

Parameters:
newActivitiesActualFiring - array containing the new values for the activities firing. This variable should have the same length of the current variable used to keep track of the activities firing.
Returns:
true if the variable has been successfully updated, false otherwise.

setArcUsage

boolean setArcUsage(cern.colt.matrix.DoubleMatrix2D newArcUsage)
Sets the variable that keeps track of how often arcs are actually used during the parsing of a log by this HeuristicsNet.

Parameters:
newArcUsage - matrix containing the new arc usage values for the activities. This variable should have the same dimension that the current matrix has.
Returns:
true if the variable has been successfully updated, false otherwise.

increaseElementActualFiring

void increaseElementActualFiring(int activity,
                                 int amount)
Increases by the specified amount the number of times an activity has fired.

Parameters:
activity - activity to have the number of firing increased.
amount - value to be added to the current amount of time the activity has fired.

increaseArcUsage

void increaseArcUsage(int activity,
                      HNSubSet usedInputActivities,
                      int amount)
Increases arc usage in this HeuristicsNet object.

Parameters:
activity - index of the activity to which output arcs should be increased.
usedInputActivities - HNSubSet with the activities to which these output arcs connect to. In other words, set containing the output activities.
amount - value by which each output arc usage should be increased.

getStartActivities

HNSubSet getStartActivities()
Retrieves the current set of start activities for this HeuristicsNet object.

Returns:
HNSubSet with the start activities.

getEndActivities

HNSubSet getEndActivities()
Retrieves the current set of end activities for this HeuristicsNet object.

Returns:
HNSubSet with the end activities.

setStartActivities

void setStartActivities(HNSubSet activities)
Sets the start activities of this HeuristicsNet object.

Parameters:
activities - HNSubSet with start activities.

setEndActivities

void setEndActivities(HNSubSet activities)
Sets the end activities of this HeuristicsNet object.

Parameters:
activities - HNSubSet with end activities.

size

int size()
Retrieves the number of activities in this HeuristicsNet object.

Returns:
number of activities.

setFitness

void setFitness(double newFitnessValue)
Sets the fitness value of this HeuristicsNet object.

Parameters:
newFitnessValue - double representing the new fitness value.

getActivitiesMappingStructures

ActivitiesMappingStructures getActivitiesMappingStructures()
Retrieves the current ActivitiesMappingStructures that is used by this HeuristicsNet object.

Returns:
ActivitiesMappingStructures currently used by this HeuristicsNet object.

setActivitiesMappingStructures

boolean setActivitiesMappingStructures(ActivitiesMappingStructures newActivitiesMappingStructures)
Replaces the current ActivitiesMappingStructures that is used by this HeuristicsNet object. Furthermore, all other related structured of the HeuristicsNet object are also updated!

Parameters:
newActivitiesMappingStructures -
Returns:
true if the variable has been successfully updated, false otherwise.

getFitness

double getFitness()
Retrieves the current fitness of this HeuristicsNet object.

Returns:
double value representing the fitness.

setInputSet

boolean setInputSet(int index,
                    HNSet sets)
Sets the input sets of a given activity in this HeuristicsNet object.

Parameters:
index - activity index.
sets - new input set.
Returns:
true if the update was successful, false otherwise.

setOutputSet

boolean setOutputSet(int index,
                     HNSet sets)
Sets the output sets of a given activity in this HeuristicsNet object.

Parameters:
index - activity index.
sets - new output set.
Returns:
true if the update was successful, false otherwise.

getInputSets

HNSet[] getInputSets()
Retrieves the array that contains all the input sets of the activities for this HeuristicsNet object.

Returns:
array with activities' input sets.

getOutputSets

HNSet[] getOutputSets()
Retrieves the array that contains all the output sets of the activities for this HeuristicsNet object.

Returns:
array with activities' output sets.

getInputSet

HNSet getInputSet(int index)
Retrieves the input set of a given activity in this HeuristicsNet object.

Parameters:
index - activity index.
Returns:
input set of this activity.

getOutputSet

HNSet getOutputSet(int index)
Retrieves the output set of a given activity in this HeuristicsNet object.

Parameters:
index - activity index.
Returns:
output set of this activity.

toString

java.lang.String toString()
Creates a string representation of this HeuristicsNet object.

Overrides:
toString in class java.lang.Object
Returns:
string representation of this HeuristicsNet object.

compareTo

int compareTo(HeuristicsNet otherHeuristicsNet)
Compares other HeuristicsNet object with this HeuristicsNet object. The comparison is based on their fitness values.

Parameters:
otherHeuristicsNet - other HeuristicsNet object to compare with this HeuristicsNet object.
Returns:
0 if the two HeuristicsNets have the same fitness value, 1 if this object's fitness value is bigger than the fitness value of the other object, -1 if the this object's fitness value is smaller than the other object's fitness value.

copy

HeuristicsNet copy()
Makes a copy (deep clone) of this HeuristicsNet object.

Returns:
a copy of this HeuristicsNet object.

equals

boolean equals(java.lang.Object other)
Checks if a given HeuristicsNet object is equal to this HeuristicsNet object. Two HeuristicsNet objects are equal when: (i) they have the same size; (ii) they contain the same ActivitiesMappingStructures; and (iii) their input and output sets are the same.

Overrides:
equals in class java.lang.Object
Parameters:
other - HeuristicsNet object to compare with this one.
Returns:
true if the two HeuristicsNet objects satisfy the three conditions above, false otherwise.

hashCode

int hashCode()
Computes the hashCode for this HeuristicsNet.

Overrides:
hashCode in class java.lang.Object
Returns:
hashcode value.

getAllElementsInputSet

HNSubSet getAllElementsInputSet(int index)
Retrieves a set containing all the input activities of a given activity.

Parameters:
index - activity to which the union set should be computed.
Returns:
HNSubSet with all input activities for this activity.

getAllElementsOutputSet

HNSubSet getAllElementsOutputSet(int index)
Retrieves a set containing all the output activities of a given activity.

Parameters:
index - activity to which the union set should be computed.
Returns:
HNSubSet with all output activities for this activity.

getInputSetsWithElement

HNSet getInputSetsWithElement(int index,
                              int element)
Retrieves subsets from an input set of an activity. These subsets contain a certain element (or activity).

Parameters:
index - activity whose input set must the searched.
element - activity to be contained in the input subsets.
Returns:
a HNSet with the subsets that contain element, or null otherwise.

getOutputSetsWithElement

HNSet getOutputSetsWithElement(int index,
                               int element)
Retrieves subsets from an output set of an activity. These subsets contain a certain element (or activity).

Parameters:
index - activity whose output set must the searched.
element - activity to be contained in the output subsets.
Returns:
a HNSet with the subsets that contain element, or null otherwise.

disconnectArcsUsedBelowThreshold

void disconnectArcsUsedBelowThreshold(double threshold)
Removes from this HeuristicsNet object all the arcs that have not been used up to a given threshold.

Parameters:
threshold - double value of the threshold to be used during the arc pruning.

disconnectUnusedElements

void disconnectUnusedElements()
Disconnects in this HeuristicsNet object the activities and arcs that are not used during the parsing of an event log.

Note: This method should be used with care since, at the starting of a parsing, no elements (activities or arcs) have been used!


getStartActivities

HNSubSet getStartActivities(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap)

getEndActivities

HNSubSet getEndActivities(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap)

getActivitiesActualFiring

int[] getActivitiesActualFiring(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap,
                                int newSize)

getArcUsage

cern.colt.matrix.DoubleMatrix2D getArcUsage(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap,
                                            int newSize)