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()
void
fire()
fire this transition, which means firing all incoming and all outgoing arksvoid
Reverse fire transition for purposes of depth-first graph searchMethods inherited from class org.tweetyproject.logics.petri.syntax.PetriNetNode
getId, getName, setId, setName
-
Constructor Details
-
Transition
Create a new transition- Parameters:
id
- a unique identifier
-
Transition
Create a new transition- Parameters:
id
- a unique identifiername
- a pretty name
-
-
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()- 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
-