public class Ark extends Edge<PetriNetNode>
A class to describe arks in a Petri net
Author:
Benedikt Knopp
  • Constructor Details

    • Ark

      public Ark(Place place, Transition transition)
      Create a new ark from a place to a transition
      Parameters:
      place - the place
      transition - the transition
    • Ark

      public Ark(Transition transition, Place place)
      Create a new ark from a transition to a place
      Parameters:
      transition - the transition
      place - the place
    • Ark

      public Ark(Place place, Transition transition, int weight)
      Create a new ark from a place to a transition with a certain weight
      Parameters:
      place - the place
      transition - the transition
      weight - the ark weight
    • Ark

      public Ark(Transition transition, Place place, int weight)
      Create a new ark from a transition to a place with a certain weight
      Parameters:
      transition - the transition
      place - the place
      weight - the ark weight
  • Method Details

    • getDirection

      public Ark.Direction getDirection()
      Returns:
      the ark direction, from place to transition or vice versa
    • getPlace

      public Place getPlace()
      Returns:
      the place of this ark
    • getTransition

      public Transition getTransition()
      Returns:
      the transition of this ark
    • getWeight

      public int getWeight()
      Returns:
      the ark weight
    • setWeight

      public void setWeight(int weight)
      Parameters:
      weight - setWeight
    • canFire

      public boolean canFire()
      Returns:
      true if this ark can fire based on its weight and properties of the connected place
    • fire

      public void fire()
      Fire this ark and conduct respective token propagations
      Throws:
      IllegalStateException - if this ark can not be fired at the moment
    • revertFire

      public void revertFire()
      reverse transition firing for purposes of graph search