Construct a continuous Petri net (fluids, but no tokens).
Construct a continuous Petri net (fluids, but no tokens).
array of colors for fluids
array of continuous places
array of timed transitions
Construct a discrete Petri net (tokens, but no fluids).
Construct a discrete Petri net (tokens, but no fluids).
array of colors for tokens
array of discrete places
array of timed transitions
array of colors for tokens/fluids
array of discrete places
array of continuous places
array of timed transitions
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.
the random variate used to compute base firing time
the weight for the token vector
the aggregate token vector (summed over all input places)
the weight for the fluid vector
the aggregate fluid level vector (summed over all input places)
Get the current time.
Show the flaw by printing the error message.
Show the flaw by printing the error message.
the method where the error occurred
the error message
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.
the fluid vector (amount of fluid per color)
the array of derivative functions
the current time
the time delay
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.
the fluid vector (amount of fluid per color)
the constant vector for base fluid flow
the rate vector (amounts of fluids per unit time)
the time delay
Get the animation command queue.
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.
the colors for nodes and edges in the graph i.e., discrete-places, continuous-places, transitions and arcs
time dilation is used to speed up/slow down animation
Simulate the execution of the Petri Net.
Simulate the execution of the Petri Net.
the starting time for the simulation
the stopping time for the simulation
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.
The fluid vector (amount of fluid per color)
The base constant vector
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.
the token vector (number of tokens per color)
the base constant vector
Convert the Petri net to the string representation.
Convert the Petri net to the string representation.
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.
the token vector (number of tokens per color)
the constant vector for base token flow
the rate vector (number of tokens per unit time)
the time delay
The
PetriNet
class provides a simulation engine for Hybrid Colored Petri Nets. Reference: "Discrete-event simulation of fluid stochastic Petri Nets"