# A Petri Net Model for Cognitive Radio Internet of Things Networks Exploiting GSM Bands +
## 4 QoS Evaluation of Secondary User Based on NMSPNs  
The interactions between the PUs and SUs in the GSM-based cognitive environment will be modeled by a class of stochastic PN model [49]. We chose PNs as the modeling tool because of their ease in representing synchronizations and parallelism, even in complex systems. In order to improve model expressiveness, several extensions have been introduced to stochastic PNs over time. Specifically, we used non-Markovian SPN (NMSPNs) [50] with enabling functions, deterministic events, and memory policies [51] to appropriately model the effects of preemption during data transmissions. An NMSPN is an SPN in which the time evolution of the marking process can be more general than a continuous-time Markov chain (CTMC) [52]. It can be defined as a tuple  
\[\mathcal{M}=(\mathcal{P},\mathcal{T},\mathcal{I},\mathcal{O},\mathcal{H}, \mathcal{E},\Phi,\mathcal{A},\Pi,M_{0})\]  
where  
* \(\mathcal{P}\) is the set of places;
* \(\mathcal{T}\) is the set of transitions;
* \(\mathcal{I},\mathcal{O},\mathcal{H}:\mathcal{T}\rightarrow\textbf{Bag}\;( \mathcal{P})\) are, respectively, the input, output, and inhibitor arcs' functions; they map the transitions to bags of places (a bag is a set in which the replication of elements is allowed, and it keeps track of the \"multiplicity\" of each element);
* \(E:\mathcal{T}\rightarrow\mathbb{R}^{+}\) is a function that maps each immediate transition \(T\in\mathcal{T}\) into a constant weight \(w\in\mathbb{R}^{+}\);
* \(\Phi:\mathcal{T}\rightarrow\mathcal{F}\) is a function that maps each timed transition \(T\in\mathcal{T}\) into a cumulative distribution function (CDF) \(F\in\mathcal{F}\);
* \(\mathcal{A}\rightarrow\{\textit{prd},\;\textit{prs},\;\textit{prij}\}\) is a function that maps each timed transition \(T\in\mathcal{T}\) into a preemption memory policy
* \(\Pi:\mathcal{T}\rightarrow\mathbb{N}^{+}\) is a function that associates a priority \(p\in\mathbb{N}^{+}\) to each transition \(T\in\mathcal{T}\);
* \(M_{0}\in\textbf{Bag}(\mathcal{P})\) is the initial marking, i.e., the initial distribution of tokens among the places in \(\mathcal{P}\), which represents the initial state of the model. The firing of a transition will occur according to the atomic firing semantics [53]; as soon as a transition is enabled, the future elapsing time occurring until the transition will fire is sampled from the related CDF; the transition will only fire after that time if it will still be enabled. Accordingly, it is possible to have more than one transition enabled at a specific time; the next one to fire will be that with the coming sampled time. After a transition fires, it will be sampled the firing times of the newly enabled transitions, and they will contribute with the previous ones to determine the next transition event (race execution policy [51]). When an enabled transition is preempted without firing, the memory policy determines how the remaining firing time is managed. Due to the memoryless property of the exponentially distributed firing time transitions, memory policies have an effect on the non-exponentially distributed firing time transition (for a more detailed discussion on preemption policies, see [52; 54; 51]. In our model, we make use of the deterministic transitions and _prs_ preemption policy, which is able to save the remaining firing time of the deterministic transitions, resuming them when re-enabled. Our overall model is organized into two interacting NMSPNs as depicted in Figures 4 and 5. Respectively, they represent an EDGE transceiver of a GSM base station used by PUs (which permits both speech phone calls using performing circuit switching access and data transmission using packet switching access) and SUs trying to opportunistically access the same band assigned to the transceiver.