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
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
check if this marking deeply equals that markinggetId()
int
Sum up the number of tokens at all non-final places at this markingint
boolean
void
Specify the number of tokens at the place at this markingvoid
-
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
- Returns:
- the id
-
setId
- Parameters:
id
- the id to set
-
getTokens
- 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
- Parameters:
place
- hasPlace- Returns:
- hasPlace
-
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
-
getSumOfTokensAtNonFinalPlaces
public int getSumOfTokensAtNonFinalPlaces()Sum up the number of tokens at all non-final places at this marking- Returns:
- the sum
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Marking>
-