Class StochPetriNetModel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidMain method for testing and demonstrating stochastic Petri net examples.static NetworkSingle-place Petri net with multiple firing modes.static NetworkBasic open stochastic Petri net with single transition.static NetworkClosed stochastic Petri net with diverse service distributions.static NetworkMulti-class closed stochastic Petri net.static NetworkColored generalized stochastic Petri net (CGSPN).static NetworkA closed net whose fluid answer is EXACT.static NetworkP1 -T1-> P2 -(immediate)-> P3 -T3-> P1.static Networkspn_fluid_immediate()with the immediate transition eliminated by hand, which is the answer the algebraic flow must reproduce.static NetworkClosed stochastic Petri net with competing transitions.static NetworkClosed stochastic Petri net with multiple firing modes and inhibition.static Networkspn_lpbounds_prodline(double[] mu) Liu (1998) Fig.static Networkspn_nrm_mm1(double lambda, double mu) An M/M/1 queue written as an OPEN Petri net: a Source Exp(lambda) feeds place P1, whose tokens drain through a single-server Transition Exp(mu) to a Sink.static Networkspn_nrm_tandem(double lambda, double mu1, double mu2) The open tandem ofspn_nrm_mm1(double, double): two places in series, each an M/M/1 queue at its own rate.static NetworkComplex open stochastic Petri net with immediate transitions.static NetworkOpen stochastic Petri net with Pareto service time.static NetworkA product-form net solved ANALYTICALLY, and one that no queueing network expresses.static NetworkP0 -(Tf)-> P1 + P2 -(Tj)-> P3 -(Tb)-> P0.static Networkspn_queueing_place(int N) Closed queueing Petri net with two queueing places.static Networkspn_queueing_place_ref(int N) The finite-population Delay + M/M/1 network the queueing Petri net ofspn_queueing_place(int)is equivalent to.static NetworkClosed stochastic Petri net with batch processing.
-
Constructor Details
-
StochPetriNetModel
public StochPetriNetModel()
-
-
Method Details
-
spn_basic_open
Basic open stochastic Petri net with single transition.Features: - Open network: Source → Place → Transition → Sink - Single transition T1 with exponential firing time (rate 4.0) - Transition requires 1 token from P1 to fire - Infinite server capacity for transition - Demonstrates basic Petri net structure in LINE
- Returns:
- configured basic stochastic Petri net model
-
spn_open_sevenplaces
Complex open stochastic Petri net with immediate transitions.Features: - 7 places and 8 transitions with mixed timing strategies - Immediate transitions (T2, T3, T4, T5) with priorities and weights - Timed transitions with Exp and Erlang distributions - Inhibiting conditions (T5 inhibited by P6) - Multiple enabling conditions and firing outcomes per transition - Initial state configuration with tokens in P1 and P5
- Returns:
- configured complex stochastic Petri net model
-
spn_twomodes
Closed stochastic Petri net with batch processing.Features: - Closed system with 10 tokens circulating between 2 places - T1 requires 4 tokens to fire, produces 4 tokens - T2 requires 2 tokens to fire, produces 2 tokens - Demonstrates batch token processing in Petri nets - All tokens initially placed in P1
- Returns:
- configured batch processing Petri net model
-
spn_fourmodes
Closed stochastic Petri net with competing transitions.Features: - 8 tokens in closed system with 3 places - T1 and T2 compete for tokens from P1 (require 2 and 3 tokens respectively) - T3 and T4 return tokens to P1 from P2 and P3 - Different firing rates create resource competition - Demonstrates resource contention in Petri nets
- Returns:
- configured competing transitions Petri net model
-
spn_inhibiting
Closed stochastic Petri net with multiple firing modes and inhibition.Features: - 4 tokens in closed system with 3 places - T1 has two firing modes: Mode1 (2 tokens → P2), Mode2 (1 token → P3) - T3 has inhibiting condition: fires only when P2 has no tokens - Demonstrates mode-based firing and inhibiting arcs - Complex token flow patterns with conditional transitions
- Returns:
- configured multi-mode Petri net with inhibition
-
spn_closed_fourplaces
Closed stochastic Petri net with diverse service distributions.Features: - 2 tokens circulating through 4 places in series - Different firing distributions: Exp, Erlang, HyperExp, Coxian - T4 uses custom Coxian distribution with specified phases - Demonstrates various probability distributions in Petri nets - All transitions require and produce 2 tokens (synchronous firing)
- Returns:
- configured Petri net with diverse distributions
-
spn_closed_twoplaces
Multi-class closed stochastic Petri net.Features: - Two job classes: Class1 (10 tokens), Class2 (7 tokens) - T1 has different modes for each class with different requirements - Class1: 2 tokens required, Class2: 1 token required - T2 and T3 handle different classes with different batch sizes - Demonstrates multi-class token management in Petri nets
- Returns:
- configured multi-class stochastic Petri net model
-
spn_basic_closed
Single-place Petri net with multiple firing modes.Features: - Single place P1 with 1 token - Single transition T1 with 3 different firing modes: - Mode1: Exponential distribution (mean 1.0) - Mode2: Erlang distribution (mean 1.0, order 2) - Mode3: HyperExponential distribution (mean 1.0, SCV 4.0) - Self-loop: transition fires and returns token to same place - Demonstrates multiple stochastic modes in single transition
- Returns:
- configured multi-mode single-place Petri net
-
spn_pareto_service
Open stochastic Petri net with Pareto service time.Features: - Open network: Source → Place → Transition → Sink - Single transition T1 with Pareto firing time (shape=3, scale=1) - Pareto distribution has mean = shape*scale/(shape-1) = 3*1/(3-1) = 1.5 - Demonstrates non-Markovian (heavy-tailed) firing times in Petri nets - Single server capacity for transition
- Returns:
- configured stochastic Petri net model with Pareto service
-
spn_productform_cyclic
A product-form net solved ANALYTICALLY, and one that no queueing network expresses.The cycle P0 -> T0 -> P1 -> T1 -> P2 -> T2 -> P0 has a product form, so
new NC(model)solves it exactly throughSpn_pf(complex balance),Mdd_rec(the normalising constant by one walk of the decision diagram holding the reachable set) andSpn_metrics.- Returns:
- the 3-place cyclic net at N = 4 with rates {1, 1.5, 2}
-
spn_productform_forkjoin
P0 -(Tf)-> P1 + P2 -(Tj)-> P3 -(Tb)-> P0.Tf consumes ONE token and produces TWO, Tj the reverse, so the marking is not a conserved job population and there is no queueing-network counterpart -- the limitation the MDD-rec paper opens with. Its place invariant is 2*m0 + m1 + m2 + 2*m3, not the token count. SolverNC's
recmethod solves it exactly.- Returns:
- the fork-join net with 3 tokens at P0
-
spn_lpbounds_prodline
Liu (1998) Fig. 2b: four servers in a line, blocking before service.t1 -> p5 -> t2 -> p4 -> t3 -> p3 -> t4, with p2, p1 and p0 holding the free slots of the three finite buffers (3, 2 and 4). Each buffer is a conserved pair of places, so the net is a strongly connected marked graph and all four transitions carry the same throughput.- Parameters:
mu- the four firing rates- Returns:
- the production line of the paper's Table 2
-
spn_queueing_place
Closed queueing Petri net with two queueing places.A CPU (single-server FCFS queueing place) and a think stage (infinite server) exchange a fixed population through two immediate transitions. This is the queueing-Petri-net rendering of a machine-repairman model, so
spn_queueing_place_ref(int)gives the exact cross-check.- Parameters:
N- the token population- Returns:
- the queueing Petri net
-
spn_queueing_place_ref
The finite-population Delay + M/M/1 network the queueing Petri net ofspn_queueing_place(int)is equivalent to.- Parameters:
N- the closed population- Returns:
- the reference queueing network
-
spn_fluid_exact
A closed net whose fluid answer is EXACT.Every mode is infinite-server with one input arc, so
min(m/w, Inf) = mand the drift is LINEAR: the fluid mean is then the exact mean and the covariance the exact covariance (a binomial marking,Binomial(4, 3/5), variance 0.96).- Returns:
- the two-place linear-drift net
-
spn_fluid_immediate
P1 -T1-> P2 -(immediate)-> P3 -T3-> P1.The vanishing place P2 holds exactly zero mass, so the net answers as
spn_fluid_reduced()does. That is what the algebraic flow buys: an approximation of the immediate transition by a large finite rate would only approach it.- Returns:
- the three-place net with one immediate transition
-
spn_fluid_reduced
spn_fluid_immediate()with the immediate transition eliminated by hand, which is the answer the algebraic flow must reproduce.- Returns:
- the reduced two-place net
-
spn_nrm_mm1
An M/M/1 queue written as an OPEN Petri net: a Source Exp(lambda) feeds place P1, whose tokens drain through a single-server Transition Exp(mu) to a Sink.- Parameters:
lambda- the arrival ratemu- the firing rate- Returns:
- the open net
-
spn_nrm_tandem
The open tandem ofspn_nrm_mm1(double, double): two places in series, each an M/M/1 queue at its own rate.- Parameters:
lambda- the arrival ratemu1- the firing rate of T1mu2- the firing rate of T2- Returns:
- the open tandem net
-
spn_colored_gspn
Colored generalized stochastic Petri net (CGSPN).A token color is a job class, so a place holds one marking per color and a transition declares one mode per color it serves. Two colors, Gold and Silver, circulate between a Buffer place and a Server place:
- the immediate transition admit has one mode per color, each held off by inhibiting arcs on BOTH colors, so the server is a mutual-exclusion resource and the firing weights arbitrate between the colors;
- the timed transition serve returns the token at a color-dependent rate.
- Returns:
- configured colored GSPN
-
main
Main method for testing and demonstrating stochastic Petri net examples.Currently configured to: - Run spn_basic_closed() with multiple firing modes - Solve using JMT solver with specified seed (23000) - Print average performance metrics - Launch JMT simulation GUI viewer - SSA analysis is commented out
- Parameters:
args- command line arguments (not used)
-