Package org.oristool.petrinet
Class PetriNet
A Petri net model.
- 
Field SummaryFields inherited from class org.oristool.util.Featurizablefeatures
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddInhibitorArc(Place p, Transition t) Adds an inhibitor arc with multiplicity 1.addInhibitorArc(Place p, Transition t, int multiplicity) Adds an inhibitor arc with given multiplicity.Adds a place to the Petri net.addPostcondition(Transition t, Place p) Adds a postcondition with multiplicity 1.addPostcondition(Transition t, Place p, int multiplicity) Adds a postcondition with given multiplicity.addPrecondition(Place p, Transition t) Adds a precondition with multiplicity 1.addPrecondition(Place p, Transition t, int multiplicity) Adds a precondition with given multiplicity.addTransition(String transitionName) Adds a transition to the Petri net.getEnabledTransitions(Marking marking) Returns the set of transitions enabled by a given marking.getInhibitorArc(Place p, Transition t) Returns the existing inhibitor arc between a place and a transition.Gets all the inhibitor arcs of a transition.Gets an existing place with the given name.Returns the names of the places in the Petri net.Returns the places of the Petri net.getPostcondition(Transition t, Place p) Returns the existing postcondition between a place and a transition.Gets all the postconditions of a transition.getPrecondition(Place p, Transition t) Returns the existing precondition between a place and a transition.Gets all the preconditions of a transition.getTransition(String transitionName) Gets an existing transition with the given name.Returns the names of the transitions in the Petri net.Returns the transitions of the Petri net.booleanisEnabled(Transition t, Marking m) Checks if a transition is enabled by a marking.Removes the existing inhibitor arc between a place and a transition.removePlace(Place p) Removes an existing place.Removes the existing postcondition between a place and a transition.Removes the existing precondition between a place and a transition.Removes an existing transition.toString()Methods inherited from class org.oristool.util.FeaturizableaddFeature, getFeature, getFeatures, hasFeature, removeFeature
- 
Constructor Details- 
PetriNetpublic PetriNet()
 
- 
- 
Method Details- 
addPlaceAdds a place to the Petri net.If a place with the same name already exists, the existing place is returned. - Parameters:
- placeName- the name of the place
- Returns:
- the place instance
 
- 
getPlaceGets an existing place with the given name.- Parameters:
- placeName- name of the place
- Returns:
- place instance, or nullif no place exists with the given name
 
- 
removePlaceRemoves an existing place.- Parameters:
- p- place to be removed
- Returns:
- the removed place
 
- 
getPlacesReturns the places of the Petri net.- Returns:
- collection of places
 
- 
getPlaceNamesReturns the names of the places in the Petri net.- Returns:
- names of the places
 
- 
addTransitionAdds a transition to the Petri net.If a transition with the same name already exists, the existing transition is returned. - Parameters:
- transitionName- the name of the transition
- Returns:
- the transition instance
 
- 
getTransitionGets an existing transition with the given name.- Parameters:
- transitionName- name of the transition
- Returns:
- transition instance, or nullif no transition exists with the given name
 
- 
removeTransitionRemoves an existing transition.- Parameters:
- t- transition to be removed
- Returns:
- the removed transition
 
- 
getTransitionsReturns the transitions of the Petri net.- Returns:
- collection of transitions
 
- 
getTransitionNamesReturns the names of the transitions in the Petri net.- Returns:
- names of the transitions
 
- 
addPreconditionAdds a precondition with multiplicity 1.- Parameters:
- p- place
- t- transition
- Returns:
- the added precondition
 
- 
addPreconditionAdds a precondition with given multiplicity.- Parameters:
- p- input place
- t- target transition
- multiplicity- precondition multiplicity
- Returns:
- the added precondition
 
- 
getPreconditionReturns the existing precondition between a place and a transition.- Parameters:
- p- input place
- t- target transition
- Returns:
- precondition between the place and the transition, or nullif no precondition exists
 
- 
removePreconditionRemoves the existing precondition between a place and a transition.- Parameters:
- pre- existing precondition
- Returns:
- precondition between the place and the transition
 
- 
getPreconditionsGets all the preconditions of a transition.- Parameters:
- t- transition
- Returns:
- preconditions of the transition
 
- 
addInhibitorArcAdds an inhibitor arc with multiplicity 1.- Parameters:
- p- place
- t- transition
- Returns:
- the added inhibitor arc
 
- 
addInhibitorArcAdds an inhibitor arc with given multiplicity.- Parameters:
- p- input place
- t- target transition
- multiplicity- inhibitor arc multiplicity
- Returns:
- the added inhibitor arc
 
- 
getInhibitorArcReturns the existing inhibitor arc between a place and a transition.- Parameters:
- p- input place
- t- target transition
- Returns:
- inhibitor arc between the place and the transition, or nullif inhibitor arc exists
 
- 
removeInhibitorArcRemoves the existing inhibitor arc between a place and a transition.- Parameters:
- ia- existing inhibitor arc
- Returns:
- inhibitor arc between the place and the transition
 
- 
getInhibitorArcsGets all the inhibitor arcs of a transition.- Parameters:
- t- transition
- Returns:
- inhibitor arcs of the transition
 
- 
addPostconditionAdds a postcondition with multiplicity 1.- Parameters:
- p- place
- t- transition
- Returns:
- the added postcondition
 
- 
addPostconditionAdds a postcondition with given multiplicity.- Parameters:
- p- input place
- t- target transition
- multiplicity- postcondition multiplicity
- Returns:
- the added postcondition
 
- 
getPostconditionReturns the existing postcondition between a place and a transition.- Parameters:
- p- input place
- t- target transition
- Returns:
- postcondition between the place and the transition, or nullif no postcondition exists
 
- 
removePostconditionRemoves the existing postcondition between a place and a transition.- Parameters:
- post- existing postcondition
- Returns:
- postcondition between the place and the transition
 
- 
getPostconditionsGets all the postconditions of a transition.- Parameters:
- t- transition
- Returns:
- postconditions of the transition
 
- 
toString- Overrides:
- toStringin class- Featurizable<PetriNetFeature>
 
- 
getEnabledTransitionsReturns the set of transitions enabled by a given marking.- Parameters:
- marking- a marking
- Returns:
- set of transitions enabled by the marking
 
- 
isEnabledChecks if a transition is enabled by a marking.- Parameters:
- t- a transition
- m- a marking
- Returns:
- trueif the transition is enabled by the marking
 
 
-