# Modeling and Analyzing Transmission of Infectious Diseases Using Generalized Stochastic Petri Nets
## 2 A Brief Overview of GSPN  
The Petri Net is a formal graphical and mathematical modeling tool which is appropriate for specifying and analyzing the behaviour of complex, distributed, and concurrent systems. A classical Petri Net is a 5-tuple \(PN=(P,T,F,W,M_{0})\), where  
* \(P\) is a finite set of places. Places, drawn as circles, model conditions or objects. * \(T\) is a finite set of transitions. Transitions, drawn as rectangles, are used to describe events that may modify the system state. * \(F\) is a set of arcs such that \(F\subseteq(P\times T)\cup(T\times P)\), which represents the arc connections from places to transitions or transitions to places. * \(W\) is a weight function that ranges from 1 to infinity, which represents the number of tokens consumed from a place through an arc or the number of tokens deposited to a place through an arc. * \(M_{0}\) is the initial marking, which a marking represents the distribution of tokens over the places. Figure 1 is a simple net containing all components of a Petri Net. There are two types of nodes: places and transitions. Places are represented by circles. Inside the places are tokens, drawn as black dots, which represent the specific value of a condition or object. A particular arrangement of the tokens across all the places is known as a marking or state. The system begins in some initial configuration known as the initial marking. Transitions, represented by rectangles, are used to describe events that may modify the system state. For example, in the Petri Net shown in Figure 1, place P1 and place P3 both have one token, while place P2 has zero tokens. The state of the net is given by the marking of the net, which is given by the number of tokens in the places. The initial marking of the Petri net from Figure 1 is \(M_{0}=[1,0,1]\). In this class of Petri Nets, all the transitions are immediate, i.e., once they are enabled and fired, the new marking is instantly reached. The arcs of the graph are classified as input arcs (arrow-headed arcs from places to transitions) and output arcs (arrow-headed arcs from transitions to places). For instance, transition T2 takes places P2 and P3 as its input places, while P1 is its output place. Arcs have capacity 1 by default. If other than 1, the capacity is marked on the arc. Places have infinite capacity by default, and transitions have no capacity, and cannot store tokens at all. A transition is enabled when the number of tokens in each of its input places is at least equal to the arc weight going from the place to the transition. This results in a new marking of the net, a state description of all places. Although classical PNs are easy to analyze, they require more places and transitions to model the behaviour of moderately complex systems, which may give rise to a state explosion problem [48]. At the same time, it is problematic to model time-dependent behavior using classical PNs. To overcome the above mentioned limitations, the original Petri net has seen much advancement. Stochastic Petri Nets (SPN) and Generalized Stochastic Petri Nets (GSPN) are among a few widely used variants in a multitude of disciplines. GSPN is defined by [PERSON] and [PERSON] [49] based on SPN. GSPN has two types of transitions: immediate transitions (to describe some logical behavior) and timed transitions (to describe the execution of time consuming activities). An exponentially distributed delay is associated with the firing of transition to provide a clear and intuitive formalism for generating Markov processes. GSPN adds the inhibitor arcs to prevent the model from becoming exceedingly large [50]. A GSPN is a 6-tuple \(GSPN=(P,T,F,W,M_{0},\Lambda)\), where  
* \(P=(\mathrm{P_{1}},\mathrm{P_{2}},\ldots\mathrm{P_{s}})\) is a finite set of places. Places, drawn as circles, model conditions or objects. * \(T=(\mathrm{T_{1}},\mathrm{T_{2}},\ldots\mathrm{T_{m}})\) is a finite set of transitions. GSPN has two types of transitions: timed transitions, represented by hollow rectangles, and immediate transitions, represented by filled rectangles.