Class Marking
java.lang.Object
org.tweetyproject.logics.petri.syntax.reachability_graph.Marking
- All Implemented Interfaces:
Comparable<Marking>,Node
A class to describe markings (i.e. a token distribution over all places) of a Petri net
- Author:
- Benedikt Knopp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleancheck if this marking deeply equals that markinggetId()Return the idReturn getPlacesintReturn the tokens at the place at this markingintgetTokensByPlace(Place place) Retrieve the number of tokens at the specified place at this markingbooleanReturn hasPlacevoidSpecify the number of tokens at the place at this markingvoidSetter id
-
Constructor Details
-
Marking
public Marking()Create a new instance -
Marking
Create a new instance- Parameters:
places- the places that this marking does describe
-
-
Method Details
-
getId
Return the id- Returns:
- the id
-
setId
Setter id- Parameters:
id- the id to set
-
getTokens
Return the tokens at the place at this marking- Parameters:
place- the place of interest- Returns:
- the tokens at the place at this marking
-
putTokens
Specify the number of tokens at the place at this marking- Parameters:
place- the id of the placetoken- the token
-
hasPlace
Return hasPlace- Parameters:
place- hasPlace- Returns:
- hasPlace
-
getPlaces
Return getPlaces- Returns:
- getPlaces
-
equals
check if this marking deeply equals that marking- Parameters:
marking- that marking to compare this marking to- Returns:
- true iff both markings describe the same set of places and the number of tokens are equal at each place
-
getTokensByPlace
Retrieve the number of tokens at the specified place at this marking- Parameters:
place- the place- Returns:
- the number of tokens at the place
-
compareTo
- Specified by:
compareToin interfaceComparable<Marking>
-