public class HeuristicsNetImpl extends java.lang.Object implements java.lang.Comparable<HeuristicsNet>, HeuristicsNet
HeuristicsNet objects that are used by the
Genetic Miner algorithm.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AND_SEPARATOR
Constant used to build the
String representation of a
HeuristicsNetImpl object. |
static java.lang.String |
EMPTY_SET
Constant used to build the
String representation of a
HeuristicsNetImpl object. |
static java.lang.String |
EVENT_SEPARATOR
Constant used to build the
String representation of a
HeuristicsNetImpl object. |
static java.lang.String |
FIELD_SEPARATOR
Constant used to build the
String representation of a
HeuristicsNetImpl object. |
static java.lang.String |
INPUT_SETS_HEADER
Constant used to build the
String representation of a
HeuristicsNetImpl object. |
static java.lang.String |
OR_SEPARATOR
Constant used to build the
String representation of a
HeuristicsNetImpl object. |
static java.lang.String |
OUTPUT_SETS_HEADER
Constant used to build the
String representation of a
HeuristicsNetImpl object. |
static java.lang.String |
SETS_SEPARATOR
Constant used to build the
String representation of a
HeuristicsNetImpl object. |
static java.lang.String |
WME_HEADER
Constant used to build the
String representation of a
HeuristicsNetImpl object. |
static char |
WME_NAME_DELIMITER
Constant used to build the
String representation of a
HeuristicsNetImpl object. |
| Constructor and Description |
|---|
HeuristicsNetImpl(ActivitiesMappingStructures activitiesMappingStructures)
Builds a
HeuristicsNetImpl objects based on a given
ActivitiesMapping object. |
| Modifier and Type | Method and Description |
|---|---|
protected HeuristicsNet |
clone()
Returns a deep cloning of the current HeuristicsNet.
|
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) |
static int[] |
getElements(HNSet set)
Returns an array contains all the activities that are in the subset of
the HNSet structure.
|
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. |
public static final java.lang.String WME_HEADER
String representation of a
HeuristicsNetImpl object.public static final char WME_NAME_DELIMITER
String representation of a
HeuristicsNetImpl object.public static final java.lang.String INPUT_SETS_HEADER
String representation of a
HeuristicsNetImpl object.public static final java.lang.String OUTPUT_SETS_HEADER
String representation of a
HeuristicsNetImpl object.public static final java.lang.String EVENT_SEPARATOR
String representation of a
HeuristicsNetImpl object.public static final java.lang.String EMPTY_SET
String representation of a
HeuristicsNetImpl object.public static final java.lang.String AND_SEPARATOR
String representation of a
HeuristicsNetImpl object.public static final java.lang.String OR_SEPARATOR
String representation of a
HeuristicsNetImpl object.public static final java.lang.String SETS_SEPARATOR
String representation of a
HeuristicsNetImpl object.public static final java.lang.String FIELD_SEPARATOR
String representation of a
HeuristicsNetImpl object.public HeuristicsNetImpl(ActivitiesMappingStructures activitiesMappingStructures)
HeuristicsNetImpl objects based on a given
ActivitiesMapping object.activitiesMappingStructures - object with the correct number of activities per
XEventClass for a given log.public void resetActivitiesActualFiring()
HeuristicsNetresetActivitiesActualFiring in interface HeuristicsNetpublic void resetArcUsage()
HeuristicsNetresetArcUsage in interface HeuristicsNetpublic int[] getActivitiesActualFiring()
HeuristicsNetgetActivitiesActualFiring in interface HeuristicsNetpublic int[] getActivitiesActualFiring(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap,
int newSize)
getActivitiesActualFiring in interface HeuristicsNetpublic cern.colt.matrix.DoubleMatrix2D getArcUsage()
HeuristicsNetgetArcUsage in interface HeuristicsNetpublic cern.colt.matrix.DoubleMatrix2D getArcUsage(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap,
int newSize)
getArcUsage in interface HeuristicsNetpublic boolean setActivitiesActualFiring(int[] newActivitiesActualFiring)
HeuristicsNetsetActivitiesActualFiring in interface HeuristicsNetnewActivitiesActualFiring - 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.true if the variable has been successfully updated,
false otherwise.public boolean setArcUsage(cern.colt.matrix.DoubleMatrix2D newArcUsage)
HeuristicsNetsetArcUsage in interface HeuristicsNetnewArcUsage - matrix containing the new arc usage values for the activities.
This variable should have the same dimension that the current
matrix has.true if the variable has been successfully updated,
false otherwise.public void increaseElementActualFiring(int activity,
int amount)
HeuristicsNetincreaseElementActualFiring in interface HeuristicsNetactivity - activity to have the number of firing increased.amount - value to be added to the current amount of time the activity
has fired.public void increaseArcUsage(int activity,
HNSubSet usedInputActivities,
int amount)
HeuristicsNetHeuristicsNet object.increaseArcUsage in interface HeuristicsNetactivity - 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.public HNSubSet getStartActivities()
HeuristicsNetHeuristicsNet object.getStartActivities in interface HeuristicsNetHNSubSet with the start activities.public HNSubSet getStartActivities(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap)
getStartActivities in interface HeuristicsNetpublic HNSubSet getEndActivities()
HeuristicsNetHeuristicsNet object.getEndActivities in interface HeuristicsNetHNSubSet with the end activities.public HNSubSet getEndActivities(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap)
getEndActivities in interface HeuristicsNetpublic void setStartActivities(HNSubSet activities)
HeuristicsNetHeuristicsNet object.setStartActivities in interface HeuristicsNetactivities - HNSubSet with start activities.public void setEndActivities(HNSubSet activities)
HeuristicsNetHeuristicsNet object.setEndActivities in interface HeuristicsNetactivities - HNSubSet with end activities.public int size()
HeuristicsNetHeuristicsNet
object.size in interface HeuristicsNetpublic void setFitness(double newFitnessValue)
HeuristicsNetHeuristicsNet object.setFitness in interface HeuristicsNetnewFitnessValue - double representing the new fitness value.public ActivitiesMappingStructures getActivitiesMappingStructures()
HeuristicsNetActivitiesMappingStructures that is
used by this HeuristicsNet object.getActivitiesMappingStructures in interface HeuristicsNetActivitiesMappingStructures currently used by this
HeuristicsNet object.public boolean setActivitiesMappingStructures(ActivitiesMappingStructures newActivitiesMappingStructures)
HeuristicsNetActivitiesMappingStructures that is
used by this HeuristicsNet object. Furthermore, all other
related structured of the HeuristicsNet object are also
updated!setActivitiesMappingStructures in interface HeuristicsNettrue if the variable has been successfully updated,
false otherwise.public double getFitness()
HeuristicsNetHeuristicsNet object.getFitness in interface HeuristicsNetpublic boolean setInputSet(int index,
HNSet sets)
HeuristicsNetHeuristicsNet object.setInputSet in interface HeuristicsNetindex - activity index.sets - new input set.true if the update was successful,
false otherwise.public boolean setOutputSet(int index,
HNSet sets)
HeuristicsNetHeuristicsNet object.setOutputSet in interface HeuristicsNetindex - activity index.sets - new output set.true if the update was successful,
false otherwise.public HNSet[] getInputSets()
HeuristicsNetHeuristicsNet object.getInputSets in interface HeuristicsNetpublic HNSet[] getOutputSets()
HeuristicsNetHeuristicsNet object.getOutputSets in interface HeuristicsNetpublic HNSet getInputSet(int index)
HeuristicsNetHeuristicsNet object.getInputSet in interface HeuristicsNetindex - activity index.public HNSet getOutputSet(int index)
HeuristicsNetHeuristicsNet object.getOutputSet in interface HeuristicsNetindex - activity index.public java.lang.String toString()
HeuristicsNetHeuristicsNet
object.toString in interface HeuristicsNettoString in class java.lang.ObjectHeuristicsNet object.public int compareTo(HeuristicsNet otherHeuristicsNet)
HeuristicsNetHeuristicsNet object with this
HeuristicsNet object. The comparison is based on their
fitness values.compareTo in interface java.lang.Comparable<HeuristicsNet>compareTo in interface HeuristicsNetotherHeuristicsNet - other HeuristicsNet object to compare with this
HeuristicsNet object.protected HeuristicsNet clone()
clone in class java.lang.Objectpublic HeuristicsNet copy()
HeuristicsNetHeuristicsNet object.copy in interface HeuristicsNetHeuristicsNet object.public boolean equals(java.lang.Object other)
HeuristicsNetHeuristicsNet 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.equals in interface HeuristicsNetequals in class java.lang.Objectother - HeuristicsNet object to compare with this one.true if the two HeuristicsNet objects
satisfy the three conditions above, false otherwise.public int hashCode()
HeuristicsNethashCode in interface HeuristicsNethashCode in class java.lang.Objectpublic HNSubSet getAllElementsInputSet(int index)
HeuristicsNetgetAllElementsInputSet in interface HeuristicsNetindex - activity to which the union set should be computed.HNSubSet with all input activities for this
activity.public HNSubSet getAllElementsOutputSet(int index)
HeuristicsNetgetAllElementsOutputSet in interface HeuristicsNetindex - activity to which the union set should be computed.HNSubSet with all output activities for this
activity.public HNSet getInputSetsWithElement(int index, int element)
HeuristicsNetgetInputSetsWithElement in interface HeuristicsNetindex - activity whose input set must the searched.element - activity to be contained in the input subsets.HNSet with the subsets that contain
element, or null otherwise.public HNSet getOutputSetsWithElement(int index, int element)
HeuristicsNetgetOutputSetsWithElement in interface HeuristicsNetindex - activity whose output set must the searched.element - activity to be contained in the output subsets.HNSet with the subsets that contain
element, or null otherwise.public static final int[] getElements(HNSet set)
set - HNSet with the subsets to be joined.public void disconnectArcsUsedBelowThreshold(double threshold)
HeuristicsNetHeuristicsNet object all the arcs that
have not been used up to a given threshold.disconnectArcsUsedBelowThreshold in interface HeuristicsNetthreshold - double value of the threshold to be used during the arc
pruning.public void disconnectUnusedElements()
HeuristicsNetHeuristicsNet 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!
disconnectUnusedElements in interface HeuristicsNet