|
Algorithm 2 Pseudo-code of RA-OLA Scheme for Random PU Traffic Patterns. |
-
1:
Initialization of parameters
-
2:
whiledo // Create PU traffic patterns.
-
3:
Generate random ON model with exponential distribution for link within .
-
4:
Generate random OFF model with exponential distribution for link within .
-
5:
end while
-
6:
Calculate probability of false alarm following Equation (13) given determined .
-
7:
Generate LHS for each UAV following the allocation Algorithm 1.
-
8:
Create a two-stage Markov machine presented in Figure 5.
-
9:
while
do
-
10:
Calculate with , F and .
-
11:
while
do
-
12:
Add Rice propagation model to the upload data.
-
13:
Identify the Markov machine state.
-
14:
Identify whether the upload data is received (power is within the threshold). The flag sets to 0 when the data is lost.
-
15:
Update the Markov machine state.
-
16:
while the received LHSs have not been fully processed do
-
17:
while Time of re-sensing is smaller than R
do
-
18:
Generate AWGN noises with length for channels.
-
19:
Calculate the sub-channel number whose power is over the threshold.
-
20:
if More than sub-channels detect the busy state. then
-
21:
.
-
22:
if The re-sensing time reaches R then
-
23:
.
-
24:
end if
-
25:
end if
-
26:
end while
-
27:
if current opportunity length
then
.
-
28:
end if
-
29:
if
, , and equal 1 then
-
30:
Summarize throughput for this opportunity.
-
31:
end if
-
32:
end while
-
33:
end while
-
34:
end while
-
35:
Calculate the simulation throughput value .
|