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
ConstructorsConstructorDescriptionTransition(String id) Create a new transitionTransition(String id, String name) Create a new transition -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIncomingArk(Ark ark) Add a new incoming ark to this transitionvoidaddOutgoingArk(Ark ark) Add a new outgoing ark to this transitionbooleancanFire()Return true if all incoming arks and all outgoing arks of this transition can firevoidfire()fire this transition, which means firing all incoming and all outgoing arksbooleanisFinal()Check if a transition is "final", that is, it fixes the final statevoidReverse fire transition for purposes of depth-first graph searchvoidsetFinal()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
-