## 4 Simulation Results and Discussion
### CPNRA Simulator Execution  
Let us assume an initial marking with two jobs (red tokens) in place \(p_{1}\) and a token in place \(p_{2}\) that is, there are two jobs that require the dominant resource and the system is ready to accept the next job request. These two jobs arrived at the same time. In Section 2, we mentioned the existence of \(m\) system queues. In each of these queues, there is a different dominant resource. Each user job entering a system queue, first makes a request for the dominant resource and then it proceeds to the next queues (if required) to request the non-dominant resources. The jobs are generated by a monitor entity, which examines the available resources and generates requests with mean arrival rate \(\lambda\). Also, it can regulate the maximum arrival rate, using our probability based policy described in Section 2. The monitor operates for as long as the current time \(Cur\_Time\) is less than the total simulation time, which is defined by the user (see the guarding expression G7 of Figure 6a). To describe how the simulator operates, let us consider an example, with these two jobs that have arrived to the system queue. Their requests are given in Table 2. The values of the black coupon \(\tau_{3}\) are: \(<1,20>\). Figure 6: Simulation execution example. At current time 20, there are two red tokens in place \(p_{1}\) (\(\tau_{1}\), \(\tau_{2}\)) and a black at \(p_{2}\) (\(\tau_{3}\)) (see Figure 6b). We now use the ideas of Section 3.1.2 to determine the firing time of the only enabled transition \(t_{1}\). For the red tokens, the minimal stamp is 20 and because this value is found in both tokens, we choose the one with the smaller Job_Id = 1. Notice that the guard expression for \(t_{1}\) is G1: (IF token_Id.ToRR = [1,x,x]), which is also true. Thus, \(t_{1}\) can fire at time \(20+\delta\), where \(\delta\) is a _delay value_. This value is produced by a random number generator with mean \(\mu\) and it indicates the time required for the system to arrive to a new state according to the event that incurred by the transition's firing. In our example, the service time is 30 time units. This means that the time elapsed until the token reaches \(p_{4}\) should equal 30 and the newly generated token will be placed to \(p_{4}\) at time = 50 time units. The result of this first firing are shown in Figure 6c: A red-black token is placed to \(p_{4}\) and its values will be the union of the red and black tokens, that is: \(\tau_{12}=\tau_{1}\cup\tau_{3}=<1,1,20,30+20,[0,0,0],1,20>=<1,1,20,30+20,[0,0,0 ],1,20>\) (see Section 3.1.1). Also, the resource request has been fulfilled, thus \(\tau_{13}\).\(ToRR=[0,0,0]\). Once \(t_{1}\) fires, the fair allocation policy of Section 2 has completed its work, that is, it has determined a fair amount of DSQ resources for the job, the resources have been allocated and the next job to be processed can be determined. The token in \(p_{4}\) activates \(t_{4}\) at time \(20+30=50\) (notice the change at the red-black token of Figure 6c). Thus, the fair allocation policy procedure executes. However, the execution of \(t_{4}\) will not produce an \"actual token\" to \(p_{1}\) because the guard G2 is false. Instead, it will produce a red token with an \(\infty\) time stamp. On the other side, the token produced for \(p_{5}\) will be a black one. Figure 6d shows this situation. Now, a black token in \(p_{5}\) activates \(t_{2}\) and the processing of next request can start. Here, we consider the delay \(\delta\) required to take the decision for the next job to be processed as a trivial latency, and we just write it as \(\delta\). Thus, the value of Arrival_Time for token \(\tau_{6}\) is \(50+\delta\) as seen in Figure 6e. Now, transition \(t_{1}\) is enabled: because the condition (see Section 3.2.3 for the description of the guard expressions used here):  
\[\text{G1: (IF token\_Id.ToRR = [1,x,x]) or (IF 2.ToRR = [1,x,x])}\] (Guard.1)  
holds for the next chosen token with token_id = 2 (which also has a time stamp of 20 time units).