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
Modifier and TypeMethodDescriptionboolean
canFire()
Return true if this ark can fire based on its weight and properties of the connected placevoid
fire()
Fire this ark and conduct respective token propagationsReturn the ark direction, from place to transition or vice versagetPlace()
Return the place of this arkReturn the transition of this arkint
Return the ark weightvoid
reverse transition firing for purposes of graph searchvoid
setWeight
(int weight) Setter Weight
-
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
Return the ark direction, from place to transition or vice versa- Returns:
- the ark direction, from place to transition or vice versa
-
getPlace
-
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
-