## 2 Materials and Methods  
### Petri Nets and Stochastic Petri Nets  
Among various methods used for modeling and simulating biological systems are those based on Petri nets. These nets are mathematical objects with a directed weighted bipartite graph structure. In other words, they consist of two disjoint subsets of vertices connected by arcs in such a way that an arc cannot connect vertices from the same subset. In the case of Petri nets, vertices belonging to one of the subsets are called places, while those being elements of the other subset are transitions. The former usually represent passive components of the modeled system (e.g., chemical compounds), while the latter are counterparts of its active components (e.g., chemical reactions or other elementary processes). Arcs represent causal relationships between components of these two types. Moreover, there is another type of element of Petri nets, i.e., tokens. They are located in places and can flow between places via transitions. The flow of tokens represents a flow of substances, signals, information, etc., in the modeled system. A distribution of tokens in places is called a marking and represents a current state of the system modeled by the net [34; 35]. A Petri net is a mathematical object formally defined in the following way. It is 5-tuple \(\mathcal{Q}=(P,T,F,W,M_{0})\), where: \(P=\{p_{1},p_{2},\ldots,p_{n}\}\) denotes a finite set of places, \(T=\{t_{1},t_{2},\ldots,t_{m}\}\) denotes a finite set of transitions, \(F\subseteq(P\times T)\cup(T\times P)\) denotes a set of arcs, \(W:F\rightarrow\mathbb{Z}^{+}\) denotes a weight function, and \(M_{0}:P\rightarrow\mathbb{N}\) is an initial marking, \(P\cap T=\emptyset\wedge P\cup T\
eq\emptyset\)[36]. Petri nets have a graphical representation, which is intuitive and thus very helpful in understanding the structure of the model. Places are represented as circles, transitions as rectangles or bars, and arcs as arrows. Tokens, on the other hand, are either dots or integer numbers located in places. Even though the graphical representation is intuitive, it is not well-suited for a formal net analysis. For this purpose, another representation is used, called an incidence matrix. In such a matrix \(A\), rows correspond to places while columns correspond to transitions. Element \(a_{ij}\) of matrix \(A\) (being an integer number) is equal to a difference between the numbers of tokens present in place \(p_{i}\) after and before firing transition \(t_{j}\)[35; 37]. Based on matrix \(A\), t-invariants can be calculated. Such an invariant is vector \(x\in\mathbb{Z}^{m}\), so equation \(A\cdot x=0\) is satisfied. While transitions correspond to elementary processes in the modeled system, t-invariants are counterparts of more complex subprocesses. For every t-invariant there is a set of transitions which is called a support of this t-invariant. Elements of support \(s(x)\) of t-invariant \(x\) are those transitions that correspond to positive entries in vector \(x\), i.e., \(s(x)=\{t_{j}:x_{j}>0,j=1,2,\ldots,m\}\). When every transition \(t_{j}\) from \(s(x)\) fires \(x_{j}\) times, then the distribution of tokens in places remains unchanged. It meansthat subprocesses corresponding to t-invariants do not change the state of the analyzed system. This makes t-invariants a basis of various methods of analysis of Petri-net-based models of biological systems [35; 37]. These invariants are a basis for grouping transitions into some sets corresponding to functional blocks of the modeled system. The sets are called Maximal Common Transition sets (MCT sets), and each of them contains transitions that belong to the supports of exactly the same t-invariants [37; 38]. Petri nets are suitable for designing qualitative models, i.e., the ones where the modeled system's structure is mainly described. In many cases, such models are very helpful in the analysis of the properties of the system. However, sometimes they are insufficient, and some quantitative aspects of the system should be considered.