class PetriNet extends PetriNetRules with Error
The PetriNet
class provides a simulation engine for Hybrid Colored Petri Nets.
Reference: "Discrete-event simulation of fluid stochastic Petri Nets"
- Alphabetic
- By Inheritance
- PetriNet
- Error
- PetriNetRules
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
PetriNet(colors: Array[Color], placeD: Array[PlaceD], transition: Array[Transition])
Construct a continuous Petri net (fluids, but no tokens).
Construct a continuous Petri net (fluids, but no tokens).
- colors
array of colors for fluids
- placeD
array of continuous places
- transition
array of timed transitions
-
new
PetriNet(colors: Array[Color], placeI: Array[PlaceI], transition: Array[Transition])
Construct a discrete Petri net (tokens, but no fluids).
Construct a discrete Petri net (tokens, but no fluids).
- colors
array of colors for tokens
- placeI
array of discrete places
- transition
array of timed transitions
-
new
PetriNet(colors: Array[Color], placeI: Array[PlaceI], placeD: Array[PlaceD], transition: Array[Transition])
- colors
array of colors for tokens/fluids
- placeI
array of discrete places
- placeD
array of continuous places
- transition
array of timed transitions
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
calcFiringDelay(v: Variate, w_t: VectorD, t: VectorI, w_f: VectorD, f: VectorD): Double
Function to compute the delay in firing a transition.
Function to compute the delay in firing a transition. The base time is given by a random variate. This is adjusted by weight vectors multiplying the number of aggregate tokens and the aggregate amount of fluids summed over all input places: delay = v + w_t * t + w_f * f.
- v
the random variate used to compute base firing time
- w_t
the weight for the token vector
- t
the aggregate token vector (summed over all input places)
- w_f
the weight for the fluid vector
- f
the aggregate fluid level vector (summed over all input places)
- Definition Classes
- PetriNetRules
-
def
clock: Double
Get the current time.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
flaw(method: String, message: String): Unit
- Definition Classes
- Error
-
def
fluidFlow(f: VectorD, derv: Array[Derivative], t0: Double, d: Double): VectorD
Compute the amount of fluid to flow over an arc according to the system of first-order Ordinary Differential Equation 'ODE's: "integral 'derv' from t0 to t".
Compute the amount of fluid to flow over an arc according to the system of first-order Ordinary Differential Equation 'ODE's: "integral 'derv' from t0 to t". Supports ODE base flow models.
- f
the fluid vector (amount of fluid per color)
- derv
the array of derivative functions
- t0
the current time
- d
the time delay
- Definition Classes
- PetriNetRules
-
def
fluidFlow(f: VectorD, b: VectorD, r: VectorD = null, d: Double = 0): VectorD
Compute the amount of fluid to flow over an arc according to the vector expression: b + r * (f-b) * d.
Compute the amount of fluid to flow over an arc according to the vector expression: b + r * (f-b) * d. If r is 0, returns b. Supports linear (w.r.t. time delay) and constant (d == 0) flow models.
- f
the fluid vector (amount of fluid per color)
- b
the constant vector for base fluid flow
- r
the rate vector (amounts of fluids per unit time)
- d
the time delay
- Definition Classes
- PetriNetRules
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getCommandQueue: ConcurrentLinkedQueue[AnimateCommand]
Get the animation command queue.
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
initAnimation(gColors: Array[Color] = ..., timeDilationFactor: Double = 1000.0): Unit
Initialize the animation by drawing the Petri net components onto the animation drawing panel using animation commands.
Initialize the animation by drawing the Petri net components onto the animation drawing panel using animation commands.
- gColors
the colors for nodes and edges in the graph i.e., discrete-places, continuous-places, transitions and arcs
- timeDilationFactor
time dilation is used to speed up/slow down animation
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
simulate(tStart: Double, tStop: Double): Unit
Simulate the execution of the Petri Net.
Simulate the execution of the Petri Net.
- tStart
the starting time for the simulation
- tStop
the stopping time for the simulation
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
thresholdD(f: VectorD, b: VectorD): Boolean
Return whether the vector inequality is true: f >= b.
Return whether the vector inequality is true: f >= b. The firing threshold should be checked for every incoming arc. If all return true, the transition should fire.
- f
The fluid vector (amount of fluid per color)
- b
The base constant vector
- Definition Classes
- PetriNetRules
-
def
thresholdI(t: VectorI, b: VectorI): Boolean
Return whether the vector inequality is true: t >= b.
Return whether the vector inequality is true: t >= b. The firing threshold should be checked for every incoming arc. If all return true, the transition should fire.
- t
the token vector (number of tokens per color)
- b
the base constant vector
- Definition Classes
- PetriNetRules
-
def
toString(): String
Convert the Petri net to the string representation.
Convert the Petri net to the string representation.
- Definition Classes
- PetriNet → AnyRef → Any
-
def
tokenFlow(t: VectorI, b: VectorI, r: VectorI = null, d: Double = 0): VectorI
Compute the number of tokens to flow over an arc according to the vector expression: b + r * (t-b) * d.
Compute the number of tokens to flow over an arc according to the vector expression: b + r * (t-b) * d. If d is 0, returns b. Supports linear (w.r.t. time delay) and constant (d == 0) flow models.
- t
the token vector (number of tokens per color)
- b
the constant vector for base token flow
- r
the rate vector (number of tokens per unit time)
- d
the time delay
- Definition Classes
- PetriNetRules
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )