Interface StochasticLabelledPetriNetSemantics
-
- All Superinterfaces:
java.lang.Cloneable
- All Known Implementing Classes:
StochasticLabelledPetriNetSemanticsImpl,StochasticLabelledPetriNetSemanticsSimpleWeightsImpl
public interface StochasticLabelledPetriNetSemantics extends java.lang.CloneableSemantics may be implemented using a state machine, thus the underlying Petri net might not be able to be changed.- Author:
- sander
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StochasticLabelledPetriNetSemanticsclone()voidexecuteTransition(int transition)Update the state to reflect execution of the transition.java.util.BitSetgetEnabledTransitions()intgetNumberOfTransitions()byte[]getState()doublegetTotalWeightOfEnabledTransitions()java.lang.StringgetTransitionLabel(int transition)Only call when it is certain that the transition is not a silent transition.doublegetTransitionWeight(int transition)booleanisFinalState()booleanisTransitionSilent(int transition)voidsetInitialState()(Re)set the semantics to the initial state.voidsetState(byte[] state)Set a copy of the given state.
-
-
-
Method Detail
-
getNumberOfTransitions
int getNumberOfTransitions()
-
setInitialState
void setInitialState()
(Re)set the semantics to the initial state.
-
executeTransition
void executeTransition(int transition)
Update the state to reflect execution of the transition.- Parameters:
transition-
-
getEnabledTransitions
java.util.BitSet getEnabledTransitions()
- Parameters:
state-- Returns:
- an array of indices of the transitions that are enabled. May be changed and stored by the caller.
-
isFinalState
boolean isFinalState()
- Returns:
- whether the current state is a final state.
-
getState
byte[] getState()
- Returns:
- a copy of the current state.
-
setState
void setState(byte[] state)
Set a copy of the given state.- Parameters:
state-
-
isTransitionSilent
boolean isTransitionSilent(int transition)
- Parameters:
transition-- Returns:
- whether the given transition is silent
-
getTransitionLabel
java.lang.String getTransitionLabel(int transition)
Only call when it is certain that the transition is not a silent transition.- Parameters:
transition-- Returns:
- the label of the transition.
-
getTransitionWeight
double getTransitionWeight(int transition)
- Parameters:
transition-- Returns:
- the weight of the transition. This might depend on the state.
-
getTotalWeightOfEnabledTransitions
double getTotalWeightOfEnabledTransitions()
- Parameters:
enabledTransitions-- Returns:
- the sum of the weight of the enabled transitions
-
clone
StochasticLabelledPetriNetSemantics clone()
-
-