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 Summary

    Constructors
    Constructor
    Description
    Create a new transition
    Create a new transition
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a new incoming ark to this transition
    void
    Add a new outgoing ark to this transition
    boolean
    Return true if all incoming arks and all outgoing arks of this transition can fire
    void
    fire this transition, which means firing all incoming and all outgoing arks
    boolean
    Check if a transition is "final", that is, it fixes the final state
    void
    Reverse fire transition for purposes of depth-first graph search
    void
    Mark a transition as "final", that is, it fixes the final state

    Methods inherited from class org.tweetyproject.logics.petri.syntax.PetriNetNode

    getId, getName, setId, setName

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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()
      Return true if all incoming arks and all outgoing arks of this transition can fire
      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