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()
HeuristicsNet
resetActivitiesActualFiring
in interface HeuristicsNet
public void resetArcUsage()
HeuristicsNet
resetArcUsage
in interface HeuristicsNet
public int[] getActivitiesActualFiring()
HeuristicsNet
getActivitiesActualFiring
in interface HeuristicsNet
public int[] getActivitiesActualFiring(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap, int newSize)
getActivitiesActualFiring
in interface HeuristicsNet
public cern.colt.matrix.DoubleMatrix2D getArcUsage()
HeuristicsNet
getArcUsage
in interface HeuristicsNet
public cern.colt.matrix.DoubleMatrix2D getArcUsage(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap, int newSize)
getArcUsage
in interface HeuristicsNet
public boolean setActivitiesActualFiring(int[] newActivitiesActualFiring)
HeuristicsNet
setActivitiesActualFiring
in interface HeuristicsNet
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.true
if the variable has been successfully updated,
false
otherwise.public boolean setArcUsage(cern.colt.matrix.DoubleMatrix2D newArcUsage)
HeuristicsNet
setArcUsage
in interface HeuristicsNet
newArcUsage
- 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)
HeuristicsNet
increaseElementActualFiring
in interface HeuristicsNet
activity
- 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)
HeuristicsNet
HeuristicsNet
object.increaseArcUsage
in interface HeuristicsNet
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.public HNSubSet getStartActivities()
HeuristicsNet
HeuristicsNet
object.getStartActivities
in interface HeuristicsNet
HNSubSet
with the start activities.public HNSubSet getStartActivities(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap)
getStartActivities
in interface HeuristicsNet
public HNSubSet getEndActivities()
HeuristicsNet
HeuristicsNet
object.getEndActivities
in interface HeuristicsNet
HNSubSet
with the end activities.public HNSubSet getEndActivities(java.util.Map<java.lang.Integer,java.lang.Integer> oldNewIndexMap)
getEndActivities
in interface HeuristicsNet
public void setStartActivities(HNSubSet activities)
HeuristicsNet
HeuristicsNet
object.setStartActivities
in interface HeuristicsNet
activities
- HNSubSet
with start activities.public void setEndActivities(HNSubSet activities)
HeuristicsNet
HeuristicsNet
object.setEndActivities
in interface HeuristicsNet
activities
- HNSubSet
with end activities.public int size()
HeuristicsNet
HeuristicsNet
object.size
in interface HeuristicsNet
public void setFitness(double newFitnessValue)
HeuristicsNet
HeuristicsNet
object.setFitness
in interface HeuristicsNet
newFitnessValue
- double representing the new fitness value.public ActivitiesMappingStructures getActivitiesMappingStructures()
HeuristicsNet
ActivitiesMappingStructures
that is
used by this HeuristicsNet
object.getActivitiesMappingStructures
in interface HeuristicsNet
ActivitiesMappingStructures
currently used by this
HeuristicsNet
object.public boolean setActivitiesMappingStructures(ActivitiesMappingStructures newActivitiesMappingStructures)
HeuristicsNet
ActivitiesMappingStructures
that is
used by this HeuristicsNet
object. Furthermore, all other
related structured of the HeuristicsNet
object are also
updated!setActivitiesMappingStructures
in interface HeuristicsNet
true
if the variable has been successfully updated,
false
otherwise.public double getFitness()
HeuristicsNet
HeuristicsNet
object.getFitness
in interface HeuristicsNet
public boolean setInputSet(int index, HNSet sets)
HeuristicsNet
HeuristicsNet
object.setInputSet
in interface HeuristicsNet
index
- activity index.sets
- new input set.true
if the update was successful,
false
otherwise.public boolean setOutputSet(int index, HNSet sets)
HeuristicsNet
HeuristicsNet
object.setOutputSet
in interface HeuristicsNet
index
- activity index.sets
- new output set.true
if the update was successful,
false
otherwise.public HNSet[] getInputSets()
HeuristicsNet
HeuristicsNet
object.getInputSets
in interface HeuristicsNet
public HNSet[] getOutputSets()
HeuristicsNet
HeuristicsNet
object.getOutputSets
in interface HeuristicsNet
public HNSet getInputSet(int index)
HeuristicsNet
HeuristicsNet
object.getInputSet
in interface HeuristicsNet
index
- activity index.public HNSet getOutputSet(int index)
HeuristicsNet
HeuristicsNet
object.getOutputSet
in interface HeuristicsNet
index
- activity index.public java.lang.String toString()
HeuristicsNet
HeuristicsNet
object.toString
in interface HeuristicsNet
toString
in class java.lang.Object
HeuristicsNet
object.public int compareTo(HeuristicsNet otherHeuristicsNet)
HeuristicsNet
HeuristicsNet
object with this
HeuristicsNet
object. The comparison is based on their
fitness values.compareTo
in interface java.lang.Comparable<HeuristicsNet>
compareTo
in interface HeuristicsNet
otherHeuristicsNet
- other HeuristicsNet
object to compare with this
HeuristicsNet
object.protected HeuristicsNet clone()
clone
in class java.lang.Object
public HeuristicsNet copy()
HeuristicsNet
HeuristicsNet
object.copy
in interface HeuristicsNet
HeuristicsNet
object.public boolean equals(java.lang.Object other)
HeuristicsNet
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.equals
in interface HeuristicsNet
equals
in class java.lang.Object
other
- HeuristicsNet
object to compare with this one.true
if the two HeuristicsNet
objects
satisfy the three conditions above, false
otherwise.public int hashCode()
HeuristicsNet
hashCode
in interface HeuristicsNet
hashCode
in class java.lang.Object
public HNSubSet getAllElementsInputSet(int index)
HeuristicsNet
getAllElementsInputSet
in interface HeuristicsNet
index
- activity to which the union set should be computed.HNSubSet
with all input activities for this
activity.public HNSubSet getAllElementsOutputSet(int index)
HeuristicsNet
getAllElementsOutputSet
in interface HeuristicsNet
index
- activity to which the union set should be computed.HNSubSet
with all output activities for this
activity.public HNSet getInputSetsWithElement(int index, int element)
HeuristicsNet
getInputSetsWithElement
in interface HeuristicsNet
index
- 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)
HeuristicsNet
getOutputSetsWithElement
in interface HeuristicsNet
index
- 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)
HeuristicsNet
HeuristicsNet
object all the arcs that
have not been used up to a given threshold.disconnectArcsUsedBelowThreshold
in interface HeuristicsNet
threshold
- double value of the threshold to be used during the arc
pruning.public void disconnectUnusedElements()
HeuristicsNet
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!
disconnectUnusedElements
in interface HeuristicsNet