PNet: A Python Library for Petri Net Modeling and Simulation

Zhu En Chay, Bing Feng Goh, Maurice HT Ling


Petri Net is a formalism to describe changes between 2 or more states across discrete time and has been used to model many systems. We present PNet – a pure Python library for Petri Net modeling and simulation in Python programming language. The design of PNet focuses on reducing the learning curve needed to define a Petri Net by using a text-based language rather than programming constructs to define transition rules. Complex transition rules can be refined as regular Python functions. To demonstrate the simplicity of PNet, we present 2 examples – bread baking, and epidemiological models.


Network modeling; Time-step simulation; Petri Net; Ordinary Differential Equation; Python

Full Text:



W. Reisig, “Petri Nets: An Introduction”, Springer–Verlag, 1985.

W. Reisig, “Understanding Petri Nets: Modeling Techniques, Analysis Methods, Case Studies”, Springer–Verlag, 2013.

T. Murata, "Petri Nets: Properties, Analysis and Applications", Proceedings of the IEEE 77, 1989, 541-580.

A. Bobbio, “System Modelling with Petri Nets”. Instituto Elettrotecnico Nazionale Galileo Ferraris Strada Delle Cacce 91, 10135 Torino, Italy, 1990, 14-15.

S. Hardy and R. Iyengar, “Analysis of Dynamical Models of Signaling Networks with Petri Nets and Dynamic Graphs”, Modeling in Systems Biology 16, 2011, 225-251.

D. Gilbert and M. Heiner M, “From Petri nets to differential equations–an integrative approach for biochemical network analysis”, Petri Nets and Other Models of Concurrency-ICATPN 2006, 2006, 181-200.

C. Chaouiya, “Petri Net Modelling of Biological Networks”, Briefings in Bioinformatics 8, 2007, pp 210-219.

H. Matsuno and A. Doi, “Hybrid Petri Net Representation of Gene Regulatory Network”, Pacific Symposium on Biocomputing 5, 2000, 338-349.

F. Liu and M. Heiner, "Modeling Membrane Systems using Colored Stochastic Petri Nets", Natural Computing 12, 2013, 617-629.

S. Proß, B. Bachmann, R. Hofestädt, K. Niehaus, R. Ueckerdt, F.-J. Vorhölter, P. Lutter, A. Stadtholz, “Modeling a Bacterium's Life: A Petri-Net Library in Modelica”, Conference Proceedings of Modelica 2009, 2009.

M. Matcovschi, C. Popescu, and O. Pastravanu, A new approach to hybrid system simulation: Development of a simulink library for petri net models," Journal of Control Engineering and Applied Informatics 7, 2005, 55-62.

F. Pommereau, “SNAKES: A Flexible High-Level Petri Nets Library (Tool Paper)”, Proceedings of the 36th International Conference on Petri Nets (PETRI NETS 2015), 2015, 254-265.

F. Brauer, “Compartmental Models in Epidemiology”, In Lecture Notes in Mathematics 1945, 2008, 19-79.

F. Brauer and C. Castillo-Chavez, “Basic Models in Epidemiology”, In Ecological Time Series 1995, 410 – 447.

M. J. Keeling and K. T.D. Eames, “Networks and epidemic models”, Journal of the Royal Society Interface 2, 2005, 295-307.

C. Ozcaglar, A. Shabbeer, S. L. Vandenberg, B. Yener, K. P. Bennett, “Epidemiological models of Mycobacterium Tuberculosis complex infections”, Mathematical Biosciences 236, 2012, 77 – 96.

P. Munz, I. Hudea, J. Imad and R. J. Smith, “When Zombies Attack!: Mathematical Modelling of Outbreak of Zombie Infection”, Infectious Disease Modelling Research Progress, 4, 2009, 133-150.

M. Ling, “COPADS IV: Fixed Time-Step ODE Solvers for a System of Equations Implemented as a Set of Python Functions”, Advances in Computer Sciences 5, 2016, xx-xxx.

J.P. Aparicio and M. Pascual, “Building Epidemiological Models from R(0): An Implicit Treatment of Transmission in Networks”, Proceedings of the Royal Society B: Biological Sciences 274, 2007, 505-512.

L. Kong, J. Wang, W. Han and Z. Cao, “Modeling Heterogeneity in Direct Infectious Disease Transmission in a Compartmental Model”, International Journal of Environmental Research and Public Health 13, 2016, 253.

M. Ling, “Of (Biological) Models and Simulations”, MOJ Proteomics & Bioinformatics 3, 2016, 00093.

S. Soliman and M. Heiner M, “A Unique Transformation from Ordinary Differential Equations to Reaction Networks”, PLoS One 5, 2010, Article e14284.

H.W. Hethcote and P. van den Driessche, “An SIS Epidemic Model with Variable Population Size and a Delay”, Journal of Mathematical Biology 34, 1995, 177-194.

“Facts about chickenpox”, Paediatrics & Child Health 10, 2005, 413-414.

Y. Chen, J. Yang and F. Zhang, “The Global Stability of an SIRS Model with Infection Age”, Mathematical Biosciences and Engineering 11, 2014, 449-469.

Lululemon Black Friday cheap nfl jerseys Lululemon factory Outlet ny Black Friday discount tiffany outlet wholesale soccer jerseys online oakley black friday cheap nhl jerseys china cheap nfl jerseys north face black friday sale cheap nfl jerseys online Jordans Black Friday Sale 2015 Cheap Moncler Cyber Monday moncler outlet cheap soccer jerseys moncler outlet black friday cheap authentic nfl jerseys north face cyber monday Louboutin Black Friday canada wholesale cheap nfl jerseys lululemon cyber monday 2015 cheap nfl jerseys from china 2015 Cheap Moncler Black Friday Sale Moncler Cyber Monday 2015 cheap jerseys Lululemon Cyber Monday Sale jordans cyber monday deals 2015 cheap nike nfl jerseys Black Friday deals Lululemon 2015 jordan black friday 2015 Moncler Jackets Black Friday Sale 2015 Louboutin Pas Cher Black Friday 2015 Canada Lululemon north face black friday cheap wholesale soccer jerseys