Research Article

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

Algorithm 2

The channel selection policy for energy harvesting.
  Input: All PUs channels, , , including idle channels, , and SUs, .
  Output: Channel selection for SUs
() begin
()    For busy channels
()   if  the data queue of SUs,   then
()     if  the energy queue of SUs,   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 laber can access the corresponding busy channel for energy harvesting in the next
          EH phase, and withdraw from other competitive sets;
()         Label values of other SUs minus one;
()       end
()     end
()   end
() end