## 3 The CPN Model
### The CPN Model
#### 3.2.3 The Guard Expressions  
The guard expressions (or guards) provide the conditions for a transition _firing_. These expressions are written in parentheses, close to the transition on which the condition is imposed. In Figure 4, there are 6 guard expressions. We use the labels G1-G6 to show them due to lack of space. In this context, we do not just use the guard expressions in the way defined in CPNs, but we have also added our own extension to make the model more flexible: Specifically, our guards not only determine firing conditions, but also they determine if a token is to be generated in an output place. This will beexplained in the description of our guards that follows:  
G1: (IF token_Id.ToRR = [1,x,x]): This indicates that \(t_{1}\) can fire only if there is a request for the DSQ regardless of the other values of ToRR. In other words, when the first ToRR value is 1, transitions \(t_{1}\) and \(t_{4}\) can fire. Once a job gets the DSQ resources, the first ToRR value, ToRR[1] becomes 0. It can become 1 again, only if the job requests extra DSQ resources, after its requests for non-dominant resources have been fulfilled.  
G2: (to \(p_{1}\): IF token_Id.ToRR = [1,x,x]): This is our own extension to the CPN guards. This extension forces \(t_{4}\) to generate a token for \(p_{1}\) only if G2 is true. If not, then even if \(t_{4}\) fires, no \"actual\" token will move to \(p_{1}\). Because the CPN formalism forces the generation of a new token anytime there is a firing, we handle the situation by generating a red token for \(p_{1}\), with a time stamp much larger than the total simulation time (this will be denoted by \(\infty\)). This token will never be processed again and hence the word \"actual\".  
G3: (IF token_Id.ToRR = [0,1,x]): This indicates that \(t_{3}\) can fire only if there is no request for the DSQ resources (it has been fulfilled) and a pending request for \(Q_{1}\) resources, regardless of the last value of ToRR. Once a job gets the \(Q_{1}\) resources, the corresponding ToRR value, ToRR[2] becomes 0. It can become 1 again if the user returns for extra resources for this job.  
G4: (to \(p_{3}\) : IF token_Id.ToRR = [0,1,x]): As in G2, for transition \(t_{5}\). This extension forces \(t_{5}\) to generate a token for \(p_{3}\) only if G4 is true. If not, then even if \(t_{5}\) fires, no \"actual\" coupon will move to \(p_{1}\). This time, a green token for \(p_{3}\), with a time stamp equal to \(\infty\) is generated. This token will never be processed again.  
G5: (IF token_Id.ToRR = [0,0,1]): This indicates that \(t_{6}\) can fire only if there is no request for the DSQ and \(Q_{1}\) resources (they have both been fulfilled or there was never a \(Q_{1}\) request from the job being processed) and a pending request for \(Q_{2}\) resources. Once a job gets the \(Q_{2}\) resources, the corresponding ToRR value, ToRR[3] becomes 0. It can become 1 again if the user returns for extra resources for this job.  
G6: (to \(p_{8}\) : IF token_Id.ToRR = [0,0,1]): This extension forces \(t_{7}\) to generate a token for \(p_{8}\) only if G6 is true. If not, then even if \(t_{7}\) fires, no \"actual\" coupon will move to \(p_{8}\). This time, a blue token for \(p_{8}\), with a time stamp equal to \(\infty\) is generated. This token will never be processed again.  
_Comment:_ In the analysis of the guard expressions, we assumed that there are 3 resources. Apparently, a similar analysis can be done for more resources.  
These guard expressions will be used to describe how the simulator executes, in the Simulation Results and Discussion section.