Research Article

Strategies for Datacenters Participating in Demand Response by Two-Stage Decisions

Algorithm 1

The process of the second stage.
Input: Iu(t), Bu(t), , ,
Output: the best individual ind_best
Begin
(1)Initialization
(2)Initialize M; pc; pm; I; newPop; P0; ind_best; i ← 1; j ← 1;
(3)while i ≤ I do
(4)for j = 1 to size(Pi) do
(5)  evaluate f(indj) for Pi
(6)end for
(7)ind_bestthe best individual
(8)while size(newPop) < M do
(9)  if random(0, 1) < pcdo
(10)   choose individual par1, par2 from Pi
(11)   determine the crossover point randomly
(12)   crossover par1 and par2
(13)   generate two new individuals x1, x2
(14)  end if
(15)  if random(0, 1) < pmdo
(16)   choose individual par3 from Pi
(17)   mutate par3 at a random point
(18)   generate a new individual x3
(19)  end if
(20)  newPop[newPop, x1, x2, x3]
(21)end while
(22)i ← i + 1
(23)PinewPop
(24)end while
(25)return ind_best
End