public interface IMarking<F extends IFlow<N>,N extends INode,P extends IPlace,T extends ITransition> extends Map<P,Integer>
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear this marking.
|
IMarking<F,N,P,T> |
clone()
Clone this marking.
|
IMarking<F,N,P,T> |
createMarking(IPetriNet<F,N,P,T> net)
Create fresh marking and associate it with a given net.
|
boolean |
fire(T transition)
Fire a transition.
|
void |
fromMultiSet(Collection<P> places)
Construct this marking from the given multi-set of places.
|
Integer |
get(P place)
Get number of tokens at a place.
|
IPetriNet<F,N,P,T> |
getPetriNet()
Get Petri net which this marking is associated with.
|
boolean |
isBounded(int n)
Check if this marking is n-bounded, i.e., there are at most n tokens at every place.
|
boolean |
isEmpty()
Returns true if this marking does not mark any place.
|
boolean |
isMarked(P place)
Check if place is marked, i.e., contains at least one token.
|
boolean |
isSafe()
Check if this marking is safe, i.e., there is at most one token at every place.
|
Integer |
put(P place,
Integer tokens)
Put specified number of tokens at a given place of the associated net.
|
Integer |
remove(P place)
Removes all tokens from a given place of the associated net.
|
void |
setPetriNet(IPetriNet<F,N,P,T> net)
Set net to associate this marking with.
|
Collection<P> |
toMultiSet()
Get marking as a multi-set of places.
|
Integer put(P place, Integer tokens) throws IllegalArgumentException
put in interface Map<P extends IPlace,Integer>place - Place of the associated net.tokens - Number of tokens to put at the given place.IllegalArgumentException - if the given place is not part of the associated net.boolean isMarked(P place)
place - Place of the associated net.Collection<P> toMultiSet()
void fromMultiSet(Collection<P> places)
places - Multi-set of places.void clear()
Integer remove(P place)
place - Place of the associated net.Integer get(P place)
place - Place of the associated net.boolean isEmpty()
IPetriNet<F,N,P,T> getPetriNet()
IMarking<F,N,P,T> createMarking(IPetriNet<F,N,P,T> net)
net - Petri net.void setPetriNet(IPetriNet<F,N,P,T> net)
net - Petri net to associate this marking with.boolean fire(T transition)
transition - Transition to fire.boolean isBounded(int n)
n - boolean isSafe()
n - Copyright © 2017. All rights reserved.