Research Article

Optimization of Cognitive Radio Secondary Information Gathering Station Positioning and Operating Channel Selection for IoT Sensor Networks

Algorithm 1

: The proposed PSO-based resource allocation algorithm.
(1)/ initialization/
(2)Generate topology of primary systems;
(3)Generate SIDs appearance probability matrix randomly;
(4)Set the values of , , , , , , and ;
(5)Determine the PSO parameters: , iteration number;
(6)Set ;
(7)Generate particle (SIGSs positions and channels) positions and velocities using Equations (13) and (14);
(8)Obtain the SIGS position and matched channel;
(9)Set ;
(10)/ calculate every particles utility function/
(11)while (iteration ≤ predetermined maximum iteration number)
(12){
(13)for population size, to
(14) {
(15)  for SIGS, to
(16)  {
(17)   Calculate the and based on particle positions;
(18)   Check the constraint using Equations (11) and (12);
(19)  if ()
(20)   {
(21)    Calculate the and using Equations (6) and (7);
(22)    Calculate Equations (8) and (9);
(23)    Obtain the value based Equation (10);
(24)   }
(25)  else
(26)  }
(27) }
(28) / evaluate every particles and /
(29)if ()
(30)  {
(31)  ;
(32)  }
(33)if ()
(34)  {
(35)  ;
(36)  }
(37) Update position and velocity of () based on Equations (13) and (14);
(38) Check position constraint;
(39) iterations ++
(40)}