Class Ark
A class to describe arks in a Petri net
- Author:
- Benedikt Knopp
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionArk
(Place place, Transition transition) Create a new ark from a place to a transitionArk
(Place place, Transition transition, int weight) Create a new ark from a place to a transition with a certain weightArk
(Transition transition, Place place) Create a new ark from a transition to a placeArk
(Transition transition, Place place, int weight) Create a new ark from a transition to a place with a certain weight -
Method Summary
-
Constructor Details
-
Ark
Create a new ark from a place to a transition- Parameters:
place
- the placetransition
- the transition
-
Ark
Create a new ark from a transition to a place- Parameters:
transition
- the transitionplace
- the place
-
Ark
Create a new ark from a place to a transition with a certain weight- Parameters:
place
- the placetransition
- the transitionweight
- the ark weight
-
Ark
Create a new ark from a transition to a place with a certain weight- Parameters:
transition
- the transitionplace
- the placeweight
- the ark weight
-
-
Method Details
-
getDirection
- Returns:
- the ark direction, from place to transition or vice versa
-
getPlace
- Returns:
- the place of this ark
-
getTransition
- Returns:
- the transition of this ark
-
getWeight
public int getWeight()- Returns:
- the ark weight
-
setWeight
public void setWeight(int weight) - Parameters:
weight
- setWeight
-
canFire
public boolean canFire()- 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
-