Class Transition
java.lang.Object
org.tweetyproject.logics.petri.syntax.PetriNetNode
org.tweetyproject.logics.petri.syntax.Transition
- All Implemented Interfaces:
Node
A class to describe transitions in a Petri net
- Author:
- Benedikt Knopp
-
Constructor Summary
ConstructorDescriptionTransition
(String id) Create a new transitionTransition
(String id, String name) Create a new transition -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIncomingArk
(Ark ark) Add a new incoming ark to this transitionvoid
addOutgoingArk
(Ark ark) Add a new outgoing ark to this transitionboolean
canFire()
Return true if all incoming arks and all outgoing arks of this transition can firevoid
fire()
fire this transition, which means firing all incoming and all outgoing arksboolean
isFinal()
Check if a transition is "final", that is, it fixes the final statevoid
Reverse fire transition for purposes of depth-first graph searchvoid
setFinal()
Mark a transition as "final", that is, it fixes the final stateMethods inherited from class org.tweetyproject.logics.petri.syntax.PetriNetNode
getId, getName, setId, setName
-
Constructor Details
-
Transition
-
Transition
-
-
Method Details
-
addIncomingArk
Add a new incoming ark to this transition- Parameters:
ark
- the incoming ark
-
addOutgoingArk
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
-