Research Article

Differential Evolution for Lifetime Maximization of Heterogeneous Wireless Sensor Networks

Pseudocode 3

The pseudocode of proposed DEDSC algorithm. Note that the pseudo code is described by Matlab language, and the bold words are inner functions or keywords in Matlab.
/* proposed DEDSC algorithm */
(1) Load test data set.
(2) Initialization parameters , et. al
  % Initialization population
(3)  round(unifrnd(1,  , popsize, m));
(4) Recombination operation
(5) ; % the generation of evolution
(6) while
(7)  ;
(8)    % mutation
(9) for   1: popsize
(10)  for   1: 
       ceil ; % round numbers
(11)    if    % boundary
     checkout
        % regenerate a random integer
        % between [1, ] to update
(12)     randint(1,1,[1, ]);
(13)    end
(14)   end
(15) end
(16) Crossover between and by (5)
     % Evaluate fitness for and
(17) for   1: popsize % for each chromosome
(18)  for   1: 
(19)   find those sensors with same subset index .
(20)   for every sensors .
(21)    count each cover the targets and
      union them.
(22)   end
(23)   if the number of targets is equal
(24)    this subset can complete coverage;
(25)   else
(26)    this subset coverage percentage is ;
(27)   end
(28)  end
(29)  count fitness of chromosome by (1);
(30)  end
(31) Selection operation by (6);
(32) Update popold;
(33)  ; % next generation
  % Judgment of terminal condition
(34) if   or the best fitness equals
(35)  break;
(36) end
(37) end