Class Transition

java.lang.Object
org.tweetyproject.logics.petri.syntax.PetriNetNode
org.tweetyproject.logics.petri.syntax.Transition
All Implemented Interfaces:
Node

public class Transition extends PetriNetNode
A class to describe transitions in a Petri net
Author:
Benedikt Knopp
  • Constructor Details

    • Transition

      public Transition(String id)
      Create a new transition
      Parameters:
      id - a unique identifier
    • Transition

      public Transition(String id, String name)
      Create a new transition
      Parameters:
      id - a unique identifier
      name - a pretty name
  • Method Details

    • addIncomingArk

      public void addIncomingArk(Ark ark)
      Add a new incoming ark to this transition
      Parameters:
      ark - the incoming ark
    • addOutgoingArk

      public void addOutgoingArk(Ark ark)
      Add a new outgoing ark to this transition
      Parameters:
      ark - the outgoing ark
    • canFire

      public boolean canFire()
      Returns:
      true if all incoming arks and all outgoing arks of this transition can fire
    • fire

      public void fire()
      fire this transition, which means firing all incoming and all outgoing arks
      Throws:
      IllegalStateException - if this transition can not fire at the moment
    • revertFire

      public void revertFire()
      Reverse fire transition for purposes of depth-first graph search
    • setFinal

      public void setFinal()
      Mark a transition as "final", that is, it fixes the final state
    • isFinal

      public boolean isFinal()
      Check if a transition is "final", that is, it fixes the final state