Class Ark


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

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Directions
  • Constructor Summary

    Constructors
    Constructor
    Description
    Ark(Place place, Transition transition)
    Create a new ark from a place to a transition
    Ark(Place place, Transition transition, int weight)
    Create a new ark from a place to a transition with a certain weight
    Ark(Transition transition, Place place)
    Create a new ark from a transition to a place
    Ark(Transition transition, Place place, int weight)
    Create a new ark from a transition to a place with a certain weight
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Return true if this ark can fire based on its weight and properties of the connected place
    void
    Fire this ark and conduct respective token propagations
    Return the ark direction, from place to transition or vice versa
    Return the place of this ark
    Return the transition of this ark
    int
    Return the ark weight
    void
    reverse transition firing for purposes of graph search
    void
    setWeight(int weight)
    Setter Weight

    Methods inherited from class org.tweetyproject.graphs.Edge

    equals, getLabel, getNodeA, getNodeB, hashCode

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait
  • 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()
      Return the ark direction, from place to transition or vice versa
      Returns:
      the ark direction, from place to transition or vice versa
    • getPlace

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

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

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

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

      public boolean canFire()
      Return true if this ark can fire based on its weight and properties of the connected place
      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