org.processmining.models.heuristics.impl
Class MarkingHeuristicsNet

java.lang.Object
  extended by org.processmining.models.heuristics.impl.MarkingHeuristicsNet

public class MarkingHeuristicsNet
extends java.lang.Object

Manages the marking of a given HeuristicsNet object.

Author:
Ana Karla Alves de Medeiros

Constructor Summary
MarkingHeuristicsNet(HeuristicsNet net, java.util.Random generator)
          Builds an initial marking for a given HeuristicsNet object.
 
Method Summary
 boolean endPlace()
          Indicates if the "end place" of HeuristicsNet object is marked
 int fire(org.deckfour.xes.classification.XEventClass event, org.deckfour.xes.model.XTrace trace, int eventPositionInTrace)
          Executes an activity linking to a given event in a log trace.
 HNSubSet getCurrentEnabledElements()
          Retrieves the current enabled activities for this current marking.
 int getCurrentNumEnabledElements()
          Retrieves the number of currently enabled activities at this marking.
 int getNumberTokens()
          The number of tokens that this marking currently contains
 int getNumTokensEndPlace()
          Retrieves the number of tokens in the "end place" of the HeuristicsNet object of this marking
 boolean isEnabled(int activity)
          Checks if an activity is enabled at this marking.
 java.lang.String printCurrentMarking()
          Creates a string representation of this marking
 boolean properlyCompleted()
          Indicates if this marking is in a proper completion state
 void reset()
          Sets this marking to its initial state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkingHeuristicsNet

public MarkingHeuristicsNet(HeuristicsNet net,
                            java.util.Random generator)
                     throws java.lang.NullPointerException
Builds an initial marking for a given HeuristicsNet object.

Parameters:
net - heuristics net object to which this marking will refer to
generator - random generator used when modifying this marking
Throws:
java.lang.NullPointerException - if any input or output set of the given HeuristicsNet object is null
Method Detail

reset

public void reset()
Sets this marking to its initial state


printCurrentMarking

public java.lang.String printCurrentMarking()
Creates a string representation of this marking

Returns:
String representation of the current marking

getNumberTokens

public int getNumberTokens()
The number of tokens that this marking currently contains

Returns:
number of tokens in this marking

properlyCompleted

public boolean properlyCompleted()
Indicates if this marking is in a proper completion state

Returns:
true if this marking is a proper completion state, false otherwise

endPlace

public boolean endPlace()
Indicates if the "end place" of HeuristicsNet object is marked

Returns:
true if the end place of is marked, false otherwise

getNumTokensEndPlace

public int getNumTokensEndPlace()
Retrieves the number of tokens in the "end place" of the HeuristicsNet object of this marking

Returns:
number of tokens contained in the end place

fire

public int fire(org.deckfour.xes.classification.XEventClass event,
                org.deckfour.xes.model.XTrace trace,
                int eventPositionInTrace)
Executes an activity linking to a given event in a log trace. The activity is executed even if it is not enabled in this marking. Additionally, in case there are multiple activities linking to this event (i.e., duplicates), the execution of a given activity is set by looking ahead in the log trace.

Parameters:
event - event linking to an activity to be fired.
trace - process instance (or trace) where the element to be fired is
eventPositionInTrace - position of the event in the process instance
Returns:
int number of tokens that needed to be added to this marking to fire an activity linking to this event.

isEnabled

public boolean isEnabled(int activity)
Checks if an activity is enabled at this marking.

Parameters:
activity - identifier of the activity to check.
Returns:
true if the activity is enabled at the this marking, false otherwise.

getCurrentEnabledElements

public HNSubSet getCurrentEnabledElements()
Retrieves the current enabled activities for this current marking.

Returns:
set of currently enabled activities

getCurrentNumEnabledElements

public int getCurrentNumEnabledElements()
Retrieves the number of currently enabled activities at this marking.

Returns:
current number of enabled activities