Class EfficientStochasticPetriNetSemanticsImpl
- java.lang.Object
-
- org.processmining.earthmoversstochasticconformancechecking.helperclasses.EfficientStochasticPetriNetSemanticsImpl
-
- All Implemented Interfaces:
java.lang.Cloneable,EfficientStochasticPetriNetSemantics
public class EfficientStochasticPetriNetSemanticsImpl extends java.lang.Object implements EfficientStochasticPetriNetSemantics
Adapted from EfficientPetrinetSemanticsImpl by Felix Mannhardt and Bas van Zelst.- Author:
- sander
-
-
Constructor Summary
Constructors Constructor Description EfficientStochasticPetriNetSemanticsImpl(org.processmining.models.graphbased.directed.petrinet.StochasticNet net, org.processmining.models.semantics.petrinet.Marking initialMarking)Creates the semantics for the suppliedStochasticNetand initialMarking.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EfficientStochasticPetriNetSemanticsImplclone()May create a shallow copy, except the state, which must be deep copied.org.processmining.models.semantics.petrinet.Markingconvert(byte[] marking)convert a primative int array to a marking object based on the internal index representation of the petri net's places.byte[]convert(org.processmining.models.semantics.petrinet.Marking marking)allows to convert a given marking to an equivalent int array based on the internal index representation of the petri net's places.voidexecuteTransition(int transitionIndex)Executes (fires) a transition.int[]getEnabledTransitions()java.lang.StringgetLabel(int transitionIndex)byte[]getState()gnu.trove.map.TObjectIntMap<org.processmining.models.graphbased.directed.petrinet.elements.Transition>getTransitionMap()doublegetTransitionWeight(int transitionIndex)booleanisInvisible(int transitionIndex)voidsetState(byte[] marking)Sets the state to the supplied state (marking).
-
-
-
Constructor Detail
-
EfficientStochasticPetriNetSemanticsImpl
public EfficientStochasticPetriNetSemanticsImpl(org.processmining.models.graphbased.directed.petrinet.StochasticNet net, org.processmining.models.semantics.petrinet.Marking initialMarking)Creates the semantics for the suppliedStochasticNetand initialMarking. This semantics class treat allStochasticNets as aStochasticNet(so does not honor the semantics of reset or inhibitor nets).- Parameters:
net- with the graph structureinitialMarking-
-
-
Method Detail
-
executeTransition
public void executeTransition(int transitionIndex)
Description copied from interface:EfficientStochasticPetriNetSemanticsExecutes (fires) a transition. For performance reasons, this method does not check whether the transition is actually enabled and does not return information on what changed.- Specified by:
executeTransitionin interfaceEfficientStochasticPetriNetSemantics
-
getEnabledTransitions
public int[] getEnabledTransitions()
- Specified by:
getEnabledTransitionsin interfaceEfficientStochasticPetriNetSemantics- Returns:
- The transitions that have a probability > 0 to fire.
-
getState
public byte[] getState()
- Specified by:
getStatein interfaceEfficientStochasticPetriNetSemantics- Returns:
- a copy of the underlying array of tokens in the current state. (marking).
-
setState
public void setState(byte[] marking)
Description copied from interface:EfficientStochasticPetriNetSemanticsSets the state to the supplied state (marking). The state array is copied into the internal data structure.- Specified by:
setStatein interfaceEfficientStochasticPetriNetSemantics
-
convert
public byte[] convert(org.processmining.models.semantics.petrinet.Marking marking)
Description copied from interface:EfficientStochasticPetriNetSemanticsallows to convert a given marking to an equivalent int array based on the internal index representation of the petri net's places.- Specified by:
convertin interfaceEfficientStochasticPetriNetSemantics- Parameters:
marking- of the petri net used wihtin semantics- Returns:
- corresponding int array
-
convert
public org.processmining.models.semantics.petrinet.Marking convert(byte[] marking)
Description copied from interface:EfficientStochasticPetriNetSemanticsconvert a primative int array to a marking object based on the internal index representation of the petri net's places.- Specified by:
convertin interfaceEfficientStochasticPetriNetSemantics- Parameters:
marking- to transform (int arr)- Returns:
- fresh marking object
-
getTransitionWeight
public double getTransitionWeight(int transitionIndex)
- Specified by:
getTransitionWeightin interfaceEfficientStochasticPetriNetSemantics- Returns:
-
isInvisible
public boolean isInvisible(int transitionIndex)
- Specified by:
isInvisiblein interfaceEfficientStochasticPetriNetSemantics- Returns:
-
getLabel
public java.lang.String getLabel(int transitionIndex)
- Specified by:
getLabelin interfaceEfficientStochasticPetriNetSemantics- Returns:
-
clone
public EfficientStochasticPetriNetSemanticsImpl clone()
Description copied from interface:EfficientStochasticPetriNetSemanticsMay create a shallow copy, except the state, which must be deep copied.- Specified by:
clonein interfaceEfficientStochasticPetriNetSemantics- Overrides:
clonein classjava.lang.Object- Returns:
-
getTransitionMap
public gnu.trove.map.TObjectIntMap<org.processmining.models.graphbased.directed.petrinet.elements.Transition> getTransitionMap()
-
-