Abstract
The recent technological advances in computer science have enabled the definition of new modeling paradigms that differ from the classical ones in describing the system in terms of its components or entities. Among them, Agent-Based Models (ABMs) are gaining more and more popularity thanks to their ability to capture emergent phenomena resulting from the interactions of individual entities. However, ABMs lack a formal definition and precisely defined semantics. To overcome this issue we propose a new method exploiting Petri Nets as a graphical meta-formalism for modeling a system from which an ABM model with clear and well-defined semantics can be automatically derived and simulated. We aim to define a framework, based on a PN formalism, in which a system can be efficiently studied through both Agent-Based Simulation and classical Stochastic one depending on the study goal.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
A marking m is a P-indexed vector, m[p] is a multiset on cd(p), and m[p][c] is the multiplicity of \(c \in cd(p)\) in the multiset m[p]; \(m(\nu )\) denotes the marking at time \(\nu \).
- 2.
Let \(\{X_i\}_{i=1}^n\) be independent exponentially distributed random variables with parameters \(\{\lambda _i\}_{i=1}^n\) respectively. Then 1) \(X = \min (X_1,\dots , X_n)\) is exponentially distributed with parameter \(\sum _{i=1}^n \lambda _i\), and 2) \(Prob(X_i = \min (X_1,\dots , X_n))\ = \ \dfrac{\lambda _i}{\sum _{i=1}^n \lambda _i}\).
- 3.
Pini, Alessia, and Simone Vantini. “The interval testing procedure: inference for functional data controlling the family-wise error rate on intervals”. MOX-Report 13 (2013): 2013.
- 4.
Bag[A] is the set of multisets built on set A, and if \(b \in Bag[A] \wedge a \in A\), b[a] denotes the multiplicity of a in the multiset b.
References
Marsan, M.A., et al.: Modelling with Generalized Stochastic Petri Nets. Wiley, Hoboken (1995)
Allen, L.: A primer on stochastic epidemic models: formulation, numerical simulation, and analysis. Infect. Dis. Modell. 2(2), 128–142 (2017)
Cao, Y., et al.: Efficient formulation of the stochastic simulation algorithm for chemically reacting systems. J. Chem. Phys. 121(9), 4059–4067 (2004)
Castagno, P., et al.: A computational framework for modeling and studying pertussis epidemiology and vaccination. BMC Bioinf. 21, 344 (2020)
Chiola, G., et al.: A structural colour simplification in well-formed coloured nets. In: Proceedings of the Fourth International Workshop on Petri Nets and Performance Models, PNPM91, pp. 144–153 (1991)
Chiola, G., et al.: Stochastic well-formed coloured nets for symmetric modelling applications. IEEE Trans. Comput. 42(11), 1343–1360 (1993)
Figueredo, G., et al.: Comparing stochastic differential equations and agent-based modelling and simulation for early-stage cancer. PLoS One 9, e95150 (2014)
Gillespie, D.T.: Exact stochastic simulation of coupled chemical reactions. J. Phys. Chem. 81(25), 2340–2361 (1977)
Gillespie, D.T.: Approximate accelerated stochastic simulation of chemically reacting systems. J. Chem. Phys. 115(4), 1716–1733 (2001)
Keeling, M., et al.: Modeling Infectious Diseases in Humans and Animals. Princeton University Press, Princeton (2008)
Law, A.M.: Simulation Modeling and Analysis, 5th edn. McGraw-Hill, New York (2015)
Perez, L., et al.: An agent-based approach for modeling dynamics of contagious disease spread. Int. J. Health Geogr. 8(1), 1–17 (2009)
Pernice, S., et al.: A computational approach based on the colored Petri net formalism for studying multiple sclerosis. BMC Bioinf. 20(6), 1–17 (2019)
Pernice, S., et al.: Computational modeling of the immune response in multiple sclerosis using epimod framework. BMC Bioinf. 21(17), 1–20 (2020)
Pernice, S., et al.: Impacts of reopening strategies for COVID-19 epidemic: a modeling study in piedmont region. BMC Infect. Dis. 20(1), 1–9 (2020)
Reinhardt, O., et al.: An efficient simulation algorithm for continuous-time agent-based linked lives models. In: Proceedings of the 50th Annual Simulation Symposium, Virginia Beach, VA, USA, 23–26 April 2017, pp. 9:1–9:12. SCS Int./ACM (2017)
Voit, E., et al.: 150 years of the mass action law. PLoS Comput. Biol. 11(1), e1004012 (2015)
Wilensky, U.: NetLogo (1999). http://ccl.northwestern.edu/netlogo/
Acknowledgements
The research work of G. Franceschinis has been partially supported by Università del Piemonte Orientale (Project MoDRI).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Appendices
Appendix 1: NetLogo Templates from ESSN to ABM Translation
Appendix 2: Simulation Results
The curves in Figs. 2 and 3 show the number of Susceptible, Exposed, Infected and Recovered people in the time period (0, 20) with an initial state comprising 1000 susceptible individuals, uniformly distributed among the \(K \in \{5, 10, 20, 25\}\) positions, and 5 infected concentrated in one position. People can freely move from one position towards any other position (with equal probability). The results are obtained by performing 1000 runs with the ESSN derived SSA (in cyan) and the NetLogo simulation (in red): the curves show consistent results.
We performed a thorough analysis to check the statistical equivalence between the SSA and the ABM simulation. We wanted to show that curves generated from two independent CTMCs \(X_1\) and \(X_2\) are equally distributed (\(X_1 \overset{d}{=} X_2\)). Since we are studying data represented by curves (i.e., functional data), we apply the functional data analysis (FDA) to test the distribution equivalence. In details, we used the R package fdatest (https://cran.r-project.org/web/packages/fdatest) in which the FDA is used to define a statistical hypothesis test with the aim to verify the null hypothesis \(X_1 \overset{d}{=} X_2\) against the alternative \(X_1 \overset{d}{\ne } X_2\). The approachFootnote 3, on which the test is based, is called the Interval Testing Procedure (ITP) and it is characterized by projecting the functional data (which belong to an infinite-dimensional space) into a finite-dimensional space with a definition of coefficients of a suitable basis expansion (i.e., B-spline) on a uniform grid. Successively, univariate permutation tests for each basis coefficient are jointly performed, and then combined to obtain the p-values for the test associated with each spline coefficient (the p-values can be further corrected to assure the control of the level of the test for each possible set of true null hypotheses).
The results obtained refer to p = 9 uniformly spaced B-splines of order m = 2, and all the places (S, E, I, R) were tested considering all the scenarios with different number of positions. Thus, in each interval characterizing the B-spline no significant differences are found (i.e., all the corrected p-values associated with each B-spline coefficients are greater than .05) between the curves obtained from the SSA and the ABM simulation.
Appendix 3: Formal Definition of the ESSN Formalism
Definition 1 (Extended Stochastic Symmetric Net)
An ESSN is a ten-tuple:
where
-
\(P=\{p_i\}\) is a finite and non empty set of places, with \(i=0,\dots , n_p\), where \(n_p\) is the number of places.
-
T is the set of transitions and is defined as \(T=T_{ma}\cup T_{g},\ \text {with}\ T_{ma}\cap T_g = \emptyset \). Where \(T_{ma}=\{t^*_i\}_{1 \le i \le n_{T_{ma}}}\) is the set of the \(n_{T_{ma}}\) transitions whose speeds follow the MA law, and \(T_g=\{\overline{t}_i\}_{1 \le i \le n_{T_g}}\) is the set of the \(n_{T_{g}}\) transitions whose speeds are defined as continuous functions.
-
\(\mathcal {C}=\{ C_1, \ldots , C_n \}\) is the finite set of basic color classes; a color class \(C_i\) can be partitioned into subclasses \(C_{i,j}\) or can be circularly ordered.
-
\(I,O[p,t]:\) \( cd (t) \rightarrow Bag[ cd (p)], \forall p \in P, t \in T\) are the input and output matricesFootnote 4, whose elements are functions annotating the directed arc connecting t and p (if the arc does not exist the corresponding function is the empty constant). The arc functions are denoted by expressions that take the form of weighted sums of tuples \(\sum _i \lambda _i . \langle f_1, \ldots , f_k \rangle [g]\), where g is a standard predicate (following the same syntax of the transition guards), the tuple elements \(f_i\) are class functions [6] built upon a restricted set of basic functions namely projection denoted by a transition variable \(v_i\), successor denoted \(!v_i\) (only defined on ordered classes), and a constant function denoted \(S_i\) (\(S_{i,j}\)) returning all the elements of (sub)class \(C_i\) (\(C_{i,j}\)):
$$ f_i = \sum _{k=1}^{m} \alpha _k. v_k + \sum _{q=1}^{||\mathcal {C}||} \sum _j \beta _{q,j}. S_{C_{q,j}} + \sum _{k=1}^{m} \gamma _{k}. !v_k; ~ \alpha _k,\beta _k,\gamma _k\in {\mathbb Z} $$ -
\( cd :\bigotimes _{i=1}^n \bigotimes _j^{e_i} C_i^j\) is a function defining the color domain of each place and transition (where \(e_i \in \mathbb {N}\) is the number of occurrences of the class \(C_i\)); for places it is expressed as the Cartesian product of basic color classes, for transitions it is expressed as a list of variables with their types. Observe that a place may contain undistinguished tokens or a transition may have no parameters, in this case their domain is neutral.
-
\(\varTheta \) is the vector of guards and maps each element of T into a standard predicate. The admissible basic predicates are \(v=v'\), \(v\in C_{i,q}\), \(d(v)=d(v')\) where \(v, v' \in var(t)\) have same type \({C_i}\) and d(v) denotes the static subclass \(C_{i,j}\) of the color assigned to v by a given transition instance \(c \in cd(t)\) (\(\varTheta (t)\) may be the constant true, that is also a standard predicate).
-
\(\omega (t,c)\) is the rate parameter of transition \(t\in T_{ma}\) when firing the instance \(\langle t,c\rangle \).
-
\(\varPhi = \{f_{\langle t,c\rangle }\}_{ t\in T \wedge c \in cd (t)} \) is set of all transition speeds \(\forall t \in T \). These must be continuous and derivable functions, and they can depend only on the marking of the input places of transition t at time \(\nu \) defined in Eqs. 1 and 2.
-
\(m_0: P \rightarrow Bag[ cd (p)]\) is the initial marking, a P-indexed vector, mapping each place p on a multiset on \( cd (p)\).
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Beccuti, M., Castagno, P., Franceschinis, G., Pennisi, M., Pernice, S. (2021). A Petri Net Formalism to Study Systems at Different Scales Exploiting Agent-Based and Stochastic Simulations. In: Ballarini, P., Castel, H., Dimitriou, I., Iacono, M., Phung-Duc, T., Walraevens, J. (eds) Performance Engineering and Stochastic Modeling. EPEW ASMTA 2021 2021. Lecture Notes in Computer Science(), vol 13104. Springer, Cham. https://doi.org/10.1007/978-3-030-91825-5_2
Download citation
DOI: https://doi.org/10.1007/978-3-030-91825-5_2
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-91824-8
Online ISBN: 978-3-030-91825-5
eBook Packages: Computer ScienceComputer Science (R0)