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.
翻译:摘要:Petri网是一种用于描述离散时间下两个或更多状态之间变化的数学形式化方法,已被广泛用于对多种系统进行建模。我们提出PNet——一个纯Python实现的Petri网建模与仿真库,适用于Python编程语言。PNet的设计重点在于通过使用基于文本的语言而非编程结构来定义变迁规则,从而降低Petri网定义的学习曲线。复杂的变迁规则可被细化为常规的Python函数。为展示PNet的简洁性,我们给出两个示例:面包烘焙模型和流行病学模型。