org.processmining.framework.models.heuristics
Class MarkingHeuristicsNet

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

public class MarkingHeuristicsNet
extends java.lang.Object

Title:

Description:

Copyright: Copyright (c) 2004

Company:

Version:
1.0
Author:
not attributable

Constructor Summary
MarkingHeuristicsNet(HeuristicsNet net, java.util.Random generator)
          Build an initial marking for a given heuristics net.
 
Method Summary
 boolean endPlace()
           
 int fire(int element, ProcessInstance pi, int elementPositionInPi)
          Fires a element even if it is not enabled.
 HNSubSet getCurrentEnabledElements()
          Returns the current enabled elements at the current marking.
 int getCurrentNumEnabledElements()
          Returns the current number of enabled elements at the current marking.
 int getNumberTokens()
          The number of places that are marked in the current net
 int getNumTokensEndPlace()
           
 boolean isEnabled(int element)
           
 java.lang.String printCurrentMarking()
          Prints the currents marking.
 boolean properlyCompleted()
           
 void reset()
          Sets the marking to the initial marking.
 
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
Build an initial marking for a given heuristics net.

Parameters:
net - an enhanced heuristics net to which the initial marking must be built.
Throws:
java.lang.NullPointerException - whenever the net has disconnected elements. An element is disconnected when its INPUT or OUTPUT set is null.
Method Detail

reset

public void reset()
Sets the marking to the initial marking.


printCurrentMarking

public java.lang.String printCurrentMarking()
Prints the currents marking.

Returns:
String containing the current marking.

getNumberTokens

public int getNumberTokens()
The number of places that are marked in the current net

Returns:
number of marked-places

properlyCompleted

public boolean properlyCompleted()

endPlace

public boolean endPlace()

getNumTokensEndPlace

public int getNumTokensEndPlace()

fire

public int fire(int element,
                ProcessInstance pi,
                int elementPositionInPi)
Fires a element even if it is not enabled. When the element has duplicates, it looks ahead to set which duplicate to fire.

Note: The element MUST be in the net.

Parameters:
element - element to be fired.
pi - process instance where the element to be fired is.
elementPositionInPi - element position.
Returns:
int number of tokens that needed to be added to fire this element.

isEnabled

public boolean isEnabled(int element)

getCurrentEnabledElements

public HNSubSet getCurrentEnabledElements()
Returns the current enabled elements at the current marking.


getCurrentNumEnabledElements

public int getCurrentNumEnabledElements()
Returns the current number of enabled elements at the current marking.