Class StochasticLabelledPetriNetSemanticsImpl
- java.lang.Object
-
- org.processmining.stochasticlabelledpetrinets.StochasticLabelledPetriNetSemanticsImpl
-
- All Implemented Interfaces:
java.lang.Cloneable,StochasticLabelledPetriNetSemantics
- Direct Known Subclasses:
StochasticLabelledPetriNetSemanticsSimpleWeightsImpl
public abstract class StochasticLabelledPetriNetSemanticsImpl extends java.lang.Object implements StochasticLabelledPetriNetSemantics
This semantics aims to avoid traversing all transitions. After construction, executing a transition will only consider the transitions whose enabledness may have changed. The only all-transition operation is BitSet.clear(). After construction, the semantics will only allocate local non-array variables.- Author:
- sander
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.BitSetenabledTransitionsprotected intnumberOfEnabledTransitions
-
Constructor Summary
Constructors Constructor Description StochasticLabelledPetriNetSemanticsImpl(StochasticLabelledPetriNet net)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StochasticLabelledPetriNetSemanticsImplclone()voidexecuteTransition(int transition)Update the state to reflect execution of the transition.java.util.BitSetgetEnabledTransitions()intgetNumberOfTransitions()byte[]getState()java.lang.StringgetTransitionLabel(int transition)Only call when it is certain that the transition is not a silent transition.booleanisFinalState()booleanisTransitionSilent(int transition)voidsetInitialState()(Re)set the semantics to the initial state.voidsetState(byte[] newState)Set a copy of the given state.-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.processmining.stochasticlabelledpetrinets.StochasticLabelledPetriNetSemantics
getTotalWeightOfEnabledTransitions, getTransitionWeight
-
-
-
-
Constructor Detail
-
StochasticLabelledPetriNetSemanticsImpl
public StochasticLabelledPetriNetSemanticsImpl(StochasticLabelledPetriNet net)
-
-
Method Detail
-
getNumberOfTransitions
public int getNumberOfTransitions()
- Specified by:
getNumberOfTransitionsin interfaceStochasticLabelledPetriNetSemantics
-
setInitialState
public void setInitialState()
Description copied from interface:StochasticLabelledPetriNetSemantics(Re)set the semantics to the initial state.- Specified by:
setInitialStatein interfaceStochasticLabelledPetriNetSemantics
-
executeTransition
public void executeTransition(int transition)
Description copied from interface:StochasticLabelledPetriNetSemanticsUpdate the state to reflect execution of the transition.- Specified by:
executeTransitionin interfaceStochasticLabelledPetriNetSemantics
-
getEnabledTransitions
public java.util.BitSet getEnabledTransitions()
- Specified by:
getEnabledTransitionsin interfaceStochasticLabelledPetriNetSemantics- Returns:
- an array of indices of the transitions that are enabled. May be changed and stored by the caller.
-
isFinalState
public boolean isFinalState()
- Specified by:
isFinalStatein interfaceStochasticLabelledPetriNetSemantics- Returns:
- whether the current state is a final state.
-
getState
public byte[] getState()
- Specified by:
getStatein interfaceStochasticLabelledPetriNetSemantics- Returns:
- a copy of the current state.
-
setState
public void setState(byte[] newState)
Description copied from interface:StochasticLabelledPetriNetSemanticsSet a copy of the given state.- Specified by:
setStatein interfaceStochasticLabelledPetriNetSemantics
-
isTransitionSilent
public boolean isTransitionSilent(int transition)
- Specified by:
isTransitionSilentin interfaceStochasticLabelledPetriNetSemantics- Returns:
- whether the given transition is silent
-
getTransitionLabel
public java.lang.String getTransitionLabel(int transition)
Description copied from interface:StochasticLabelledPetriNetSemanticsOnly call when it is certain that the transition is not a silent transition.- Specified by:
getTransitionLabelin interfaceStochasticLabelledPetriNetSemantics- Returns:
- the label of the transition.
-
clone
public StochasticLabelledPetriNetSemanticsImpl clone()
- Specified by:
clonein interfaceStochasticLabelledPetriNetSemantics- Overrides:
clonein classjava.lang.Object
-
-