Class StochasticLabelledPetriNetImpl
- java.lang.Object
-
- org.processmining.stochasticlabelledpetrinets.StochasticLabelledPetriNetImpl
-
- All Implemented Interfaces:
StochasticLabelledPetriNet,StochasticLabelledPetriNetEditable
- Direct Known Subclasses:
StochasticLabelledPetriNetSimpleWeightsImpl
public abstract class StochasticLabelledPetriNetImpl extends java.lang.Object implements StochasticLabelledPetriNetEditable
-
-
Constructor Summary
Constructors Constructor Description StochasticLabelledPetriNetImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddPlace()voidaddPlaceToInitialMarking(int place)Adds a token to the given place in the final marking.voidaddPlaceToInitialMarking(int place, int cardinality)voidaddPlaceTransitionArc(int place, int transition)voidaddPlaceTransitionArc(int place, int transition, int cardinality)intaddTransition(double weight)Add a silent transition.intaddTransition(java.lang.String label, double weight)Add a labelled transition.voidaddTransitionPlaceArc(int transition, int place)voidaddTransitionPlaceArc(int transition, int place, int cardinality)int[]getInputPlaces(int transition)int[]getInputTransitions(int place)intgetNumberOfPlaces()intgetNumberOfTransitions()int[]getOutputPlaces(int transition)int[]getOutputTransitions(int place)java.lang.StringgetTransitionLabel(int transition)Only call when it is certain that the transition is not a silent transition.intisInInitialMarking(int place)booleanisTransitionSilent(int transition)voidmakeTransitionSilent(int transition)voidsetTransitionLabel(int transition, java.lang.String label)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.processmining.stochasticlabelledpetrinets.StochasticLabelledPetriNet
getDefaultSemantics
-
-
-
-
Method Detail
-
getNumberOfTransitions
public int getNumberOfTransitions()
- Specified by:
getNumberOfTransitionsin interfaceStochasticLabelledPetriNet- Returns:
- the number of transitions. All transitions have indices starting at 0 and ending at the returned value (exclusive).
-
getNumberOfPlaces
public int getNumberOfPlaces()
- Specified by:
getNumberOfPlacesin interfaceStochasticLabelledPetriNet- Returns:
- the number of places. All places have indices starting at 0 and ending at the returned value (exclusive).
-
getTransitionLabel
public java.lang.String getTransitionLabel(int transition)
Description copied from interface:StochasticLabelledPetriNetOnly call when it is certain that the transition is not a silent transition.- Specified by:
getTransitionLabelin interfaceStochasticLabelledPetriNet- Returns:
- the label of the transition.
-
isTransitionSilent
public boolean isTransitionSilent(int transition)
- Specified by:
isTransitionSilentin interfaceStochasticLabelledPetriNet- Returns:
- whether the transition is a silent transition
-
isInInitialMarking
public int isInInitialMarking(int place)
- Specified by:
isInInitialMarkingin interfaceStochasticLabelledPetriNet- Returns:
- the number of tokens on this place in the initial marking.
-
getInputPlaces
public int[] getInputPlaces(int transition)
- Specified by:
getInputPlacesin interfaceStochasticLabelledPetriNet- Returns:
- a list of places that have arcs to this transition. Transitions may appear multiple times. The caller must not change the returned array.
-
getOutputPlaces
public int[] getOutputPlaces(int transition)
- Specified by:
getOutputPlacesin interfaceStochasticLabelledPetriNet- Returns:
- a list of places that have arcs from this transition. Transitions may appear multiple times. The caller must not change the returned array.
-
getInputTransitions
public int[] getInputTransitions(int place)
- Specified by:
getInputTransitionsin interfaceStochasticLabelledPetriNet- Returns:
- a list of transitions that have arcs to this place. Places may appear multiple times. The caller must not change the returned array.
-
getOutputTransitions
public int[] getOutputTransitions(int place)
- Specified by:
getOutputTransitionsin interfaceStochasticLabelledPetriNet- Returns:
- a list of transitions that have arcs from this place. Places may appear multiple times. The caller must not change the returned array.
-
setTransitionLabel
public void setTransitionLabel(int transition, java.lang.String label)- Specified by:
setTransitionLabelin interfaceStochasticLabelledPetriNetEditable
-
makeTransitionSilent
public void makeTransitionSilent(int transition)
- Specified by:
makeTransitionSilentin interfaceStochasticLabelledPetriNetEditable
-
addTransition
public int addTransition(java.lang.String label, double weight)Description copied from interface:StochasticLabelledPetriNetEditableAdd a labelled transition.- Specified by:
addTransitionin interfaceStochasticLabelledPetriNetEditable- Returns:
- the index of the transition.
-
addTransition
public int addTransition(double weight)
Description copied from interface:StochasticLabelledPetriNetEditableAdd a silent transition.- Specified by:
addTransitionin interfaceStochasticLabelledPetriNetEditable- Returns:
- the index of the transition.
-
addPlace
public int addPlace()
- Specified by:
addPlacein interfaceStochasticLabelledPetriNetEditable- Returns:
- the index of the place.
-
addPlaceToInitialMarking
public void addPlaceToInitialMarking(int place, int cardinality)- Specified by:
addPlaceToInitialMarkingin interfaceStochasticLabelledPetriNetEditablecardinality- May be negative, however ensure the final marking contains a positive number of tokens in each place.
-
addPlaceToInitialMarking
public void addPlaceToInitialMarking(int place)
Description copied from interface:StochasticLabelledPetriNetEditableAdds a token to the given place in the final marking.- Specified by:
addPlaceToInitialMarkingin interfaceStochasticLabelledPetriNetEditable
-
addPlaceTransitionArc
public void addPlaceTransitionArc(int place, int transition)- Specified by:
addPlaceTransitionArcin interfaceStochasticLabelledPetriNetEditable
-
addPlaceTransitionArc
public void addPlaceTransitionArc(int place, int transition, int cardinality)- Specified by:
addPlaceTransitionArcin interfaceStochasticLabelledPetriNetEditablecardinality- May be negative.
-
addTransitionPlaceArc
public void addTransitionPlaceArc(int transition, int place)- Specified by:
addTransitionPlaceArcin interfaceStochasticLabelledPetriNetEditable
-
addTransitionPlaceArc
public void addTransitionPlaceArc(int transition, int place, int cardinality)- Specified by:
addTransitionPlaceArcin interfaceStochasticLabelledPetriNetEditablecardinality- May be negative.
-
-