java.lang.Object
org.tweetyproject.logics.petri.syntax.reachability_graph.Marking
All Implemented Interfaces:
Comparable<Marking>, Node

public class Marking extends Object implements Node, Comparable<Marking>
A class to describe markings (i.e. a token distribution over all places) of a Petri net
Author:
Benedikt Knopp
  • Constructor Details

    • Marking

      public Marking()
      Create a new instance
    • Marking

      public Marking(List<Place> places)
      Create a new instance
      Parameters:
      places - the places that this marking does describe
  • Method Details

    • getId

      public String getId()
      Returns:
      the id
    • setId

      public void setId(String id)
      Parameters:
      id - the id to set
    • getTokens

      public int getTokens(Place place)
      Parameters:
      place - the place of interest
      Returns:
      the tokens at the place at this marking
    • putTokens

      public void putTokens(Place place, int token)
      Specify the number of tokens at the place at this marking
      Parameters:
      place - the id of the place
      token - the token
    • hasPlace

      public boolean hasPlace(Place place)
      Parameters:
      place - hasPlace
      Returns:
      hasPlace
    • getPlaces

      public Set<Place> getPlaces()
      Returns:
      getPlaces
    • equals

      public boolean equals(Marking marking)
      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

      public int getTokensByPlace(Place place)
      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

      public int compareTo(Marking that)
      Specified by:
      compareTo in interface Comparable<Marking>