public class Marking
extends java.lang.Object
| Constructor and Description |
|---|
Marking(Marking m)
Copy-Constructor.
|
Marking(PetriNet net)
Constructor.
|
Marking(PetriNet net,
int... orderedTokenCounts)
Set the Marking for the given net.
|
Marking(PetriNet net,
java.util.Map<java.lang.String,java.lang.Integer> m)
Constructor.
|
Marking(PetriNet net,
Marking m)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToken(Place p,
int m)
Deprecated.
Markings should be used immutably. Use
addTokenCount instead. |
void |
addToken(Place p,
Token m)
Deprecated.
Markings should be used immutably. Use
addTokenCount instead. |
void |
addToken(java.lang.String id,
int m)
Deprecated.
Markings should be used immutably. Use
addTokenCount instead. |
void |
addToken(java.lang.String id,
Token m)
Deprecated.
Markings should be used immutably. Use
addTokenCount instead. |
Marking |
addTokenCount(Place p,
int m)
Adds the given token(s) to a given place.
|
Marking |
addTokenCount(Place p,
Token m)
Adds the given token(s) to a given place.
|
Marking |
addTokenCount(java.lang.String id,
int m)
Adds the given token(s) to a place with the given id.
|
Marking |
addTokenCount(java.lang.String id,
Token m)
Adds the given token(s) to a given place.
|
Marking |
cover(Marking o)
Check if this object covers the given other marking.
|
boolean |
covers(Marking o)
Deprecated.
Markings should be used immutably. Use
cover instead. |
boolean |
equals(java.lang.Object obj) |
Marking |
fire(Transition... t)
Deprecated.
Markings should be used immutably. Use
fireTransitions instead. |
Marking |
fireTransitions(Transition... t)
Fires the given transitions and creates a new marking.
|
PetriNet |
getNet()
Returns the corresponding net of this marking.
|
Token |
getToken(Place p)
Returns the token count of the given place.
|
Token |
getToken(java.lang.String id)
Returns the token count of the given place with the given id.
|
int |
hashCode() |
boolean |
hasOmega()
Check if the marking contains at least one omega.
|
void |
setToken(Place p,
int m)
Deprecated.
Markings should be used immutably. Use
setTokenCount instead. |
void |
setToken(Place p,
Token m)
Deprecated.
Markings should be used immutably. Use
setTokenCount instead. |
void |
setToken(java.lang.String placeId,
int m)
Deprecated.
Markings should be used immutably. Use
setTokenCount instead. |
void |
setToken(java.lang.String placeId,
Token m)
Deprecated.
Markings should be used immutably. Use
setTokenCount instead. |
Marking |
setTokenCount(Place p,
int m)
Sets the given token(s) on a given place.
|
Marking |
setTokenCount(Place p,
Token m)
Sets the given token(s) on a given place.
|
Marking |
setTokenCount(java.lang.String placeId,
int m)
Sets the given token(s) on a place with the given id.
|
Marking |
setTokenCount(java.lang.String placeId,
Token m)
Sets the given token(s) on a place with the given id.
|
java.lang.String |
toString() |
java.util.Collection<Token> |
values()
Return the tokens that appear in this marking.
|
public Marking(PetriNet net)
net - - the net for that the marking is created.public Marking(Marking m)
m - - the marking that serves as template for creating the copy.public Marking(PetriNet net, Marking m)
net - The net for which the marking instance gets created.m - A marking from which the mapping from places to token is copied.StructureException - if the places of the given net and tokenmap do not fit.public Marking(PetriNet net, java.util.Map<java.lang.String,java.lang.Integer> m)
net - The net for which the marking instance gets created.m - A mapping from Place ids to tokens.StructureException - if the places of the given net and tokenmap do not fit.public Marking(PetriNet net, int... orderedTokenCounts)
net - - the net the marking belongs to.orderedTokenCounts - - list of token count for the places in lexical order.StructureException - thrown if the size of places in the given net and the length of the list of
tokens does not fit.java.lang.IllegalArgumentException - thrown if a token count is less than zero.public PetriNet getNet()
public Marking fireTransitions(Transition... t)
t - - the transitions that should be fired.@Deprecated public Marking fire(Transition... t)
fireTransitions instead.t - - the transitions that should be fired.public Marking setTokenCount(java.lang.String placeId, Token m)
placeId - the place id.m - the token.StructureException - if the places of this net and the given token do not fit.@Deprecated
public void setToken(java.lang.String placeId,
Token m)
setTokenCount instead.placeId - the place id.m - the token.StructureException - if the places of this net and the given token do not fit.public Marking setTokenCount(java.lang.String placeId, int m)
placeId - the place id.m - the token.StructureException - thrown if the places of this net and the given token do not fit.java.lang.IllegalArgumentException - thrown if a token count is less than zero.@Deprecated
public void setToken(java.lang.String placeId,
int m)
setTokenCount instead.placeId - the place id.m - the token.StructureException - thrown if the places of this net and the given token do not fit.java.lang.IllegalArgumentException - thrown if a token count is less than zero.public Marking setTokenCount(Place p, Token m)
p - the place.m - the token.StructureException - if the the given place don't belong to the net of this marking.@Deprecated public void setToken(Place p, Token m)
setTokenCount instead.p - the place.m - the token.StructureException - if the the given place don't belong to the net of this marking.public Marking setTokenCount(Place p, int m)
p - the place.m - the number of tokens on this place.StructureException - if the the given place don't belong to the net of this marking.java.lang.IllegalArgumentException - thrown if a token count is less than zero.@Deprecated public void setToken(Place p, int m)
setTokenCount instead.p - the place.m - the number of tokens on this place.StructureException - if the the given place don't belong to the net of this marking.java.lang.IllegalArgumentException - thrown if a token count is less than zero.public Marking addTokenCount(java.lang.String id, Token m)
id - the place id.m - the number of tokens that get added.NoSuchNodeException - thrown if the place with the given id don't exists in the net.@Deprecated
public void addToken(java.lang.String id,
Token m)
addTokenCount instead.id - the place id.m - the number of tokens that get added.NoSuchNodeException - thrown if the place with the given id don't exists in the net.public Marking addTokenCount(Place p, Token m)
p - the place.m - the token.NoSuchNodeException - if the place does not exist in the given net.@Deprecated public void addToken(Place p, Token m)
addTokenCount instead.p - the place.m - the token.NoSuchNodeException - if the place does not exist in the given net.public Marking addTokenCount(java.lang.String id, int m)
id - the place id.m - the number of tokens that get added.java.lang.IllegalArgumentException - if the result of this addition would be less than zero.NoSuchNodeException - if the place does not exist in the given net.@Deprecated
public void addToken(java.lang.String id,
int m)
addTokenCount instead.id - the place id.m - the number of tokens that get added.java.lang.IllegalArgumentException - if the result of this addition would be less than zero.NoSuchNodeException - if the place does not exist in the given net.public Marking addTokenCount(Place p, int m)
p - the place.m - the number of tokens that get added.java.lang.IllegalArgumentException - if the result of this addition would be less than zero.NoSuchNodeException - if the place does not exist in the given net.@Deprecated public void addToken(Place p, int m)
addTokenCount instead.p - the place.m - the number of tokens that get added.java.lang.IllegalArgumentException - if the result of this addition would be less than zero.NoSuchNodeException - if the place does not exist in the given net.public Token getToken(java.lang.String id)
id - a string containing an id of a place in the corresponding net.NoSuchNodeException - thrown if the place with the given id does not belong to the net.public Token getToken(Place p)
p - a place of the corresponding net.StructureException - thrown if the place belong to an other net.NoSuchNodeException - thrown if the place with the given id does not exists in the net.public java.util.Collection<Token> values()
Token that appears as a value in this marking.public Marking cover(Marking o)
o - The marking that should be covered.@Deprecated public boolean covers(Marking o)
cover instead.o - The marking that should be covered.public boolean hasOmega()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object