Research Article

Channel Selection Policy in Multi-SU and Multi-PU Cognitive Radio Networks with Energy Harvesting for Internet of Everything

Algorithm 1

The channel selection policy for data transmission.
  Input: All PUs channels, , , including idle channels, , and SUs, .
  Output: Channel selection for SUs
() begin
()    For idle channels
()   if  the data queue of SUs,   then
()     if    then
()      if  the SUs receive CTS packet successfully  then
()        The SUs form a number of competitive sets, , ;
()        Randomly assigning them integer labels from zero to , ;
()        for  erery competitive sets,   do
()          The SU who obtains the zero label can access the corresponding channel for data transmission, and
            withdraw from other competitive sets;
()          Label values of other SUs minus one;
()        end
()      end
()     end
()     if    then
()       if  the SUs receive CTS packet successfully  then
()         if  the SUs transmit the data in the Underlay model, and their throughput can be satisfied  then
()          The SUs form a number of competitive sets, , ;
()          Randomly assigning them integer labels from zero to , ;
()          for  erery competitive sets,   do
()           The SU who obtains the zero label can reduce its transmitting power and access the corresponding
            channel for data transmission, and then withdraw from other competitive sets;
()           Label values of other SUs minus one;
()          end
()         end
()       end
()     end
()   end
() end