Research Article

Hybrid PSO-SA Type Algorithms for Multimodal Function Optimization and Reducing Energy Consumption in Embedded Systems

Algorithm 1

HPSO-SA hybrid algorithm.
(1)  iter ← 0, 𝑐 𝑝 𝑑 ← 0 , Initialize 𝑠 𝑀 π‘Ž π‘Ÿ π‘š _ 𝑠 𝑖 𝑧 𝑒 particles  
(2)  stop_criterion ← maximum number of function evaluations or 𝑂 𝑝 𝑑 𝑖 π‘š π‘Ž 𝑙 _ 𝑠 π‘œ 𝑙 𝑒 𝑑 𝑖 π‘œ 𝑛 is not attained
(3)  while   Not stop_criterion  do
(4)       for  each particle 𝑖 ← 1   to   𝑠 𝑀 π‘Ž π‘Ÿ π‘š _ 𝑠 𝑖 𝑧 𝑒   do
(5)      Evaluate ( 𝑝 π‘Ž π‘Ÿ 𝑑 𝑖 𝑐 𝑙 𝑒 ( 𝑖 ) )   if  the fitness value is better than the best fitness value (cbest) in history  then
(6)          Update current value as the new 𝑐 𝑏 𝑒 𝑠 𝑑 .
(7)      end
(8)       end
(9)       Choose the particle with the best fitness value in the neighborhood ( 𝑔 𝑏 𝑒 𝑠 𝑑 )
(10)       for  each particle 𝑖 ← 1   to   𝑠 𝑀 π‘Ž π‘Ÿ π‘š _ 𝑠 𝑖 𝑧 𝑒   do
(11)       Update particle velocity according to Equation  (3)
(12)        Enforce velocity bounds
(13)        Update particle position according to Equation  (4)
(14)        Enforce particle bounds
(15)       end
(16)       if  there is no improvement of global best solution  then
(17)      𝑐 𝑝 𝑑 ← 𝑐 𝑝 𝑑 + 1
(18)       end
(19)       Update global best solution
(20)        𝑐 𝑝 𝑑 ← 0
(21)       if   𝑐 𝑝 𝑑 = 𝐾   then
(22)      𝑐 𝑝 𝑑 ← 0
(23)       / / Apply SA to global best solution
(24)      iterSA ← 0, Initialize 𝑇 according to Equation  (5)
(25)       𝑐 𝑒 π‘Ÿ π‘Ÿ 𝑒 𝑛 𝑑 _ 𝑠 π‘œ 𝑙 𝑒 𝑑 𝑖 π‘œ 𝑛 ← global_best_solution
(26)       𝑐 𝑒 π‘Ÿ π‘Ÿ 𝑒 𝑛 𝑑 _ 𝑐 π‘œ 𝑠 𝑑 ← Evaluate( 𝑐 𝑒 π‘Ÿ π‘Ÿ 𝑒 𝑛 𝑑 _ 𝑠 π‘œ 𝑙 𝑒 𝑑 𝑖 π‘œ 𝑛 )
(27)      while  Not SA_stop_criterion  do
(28)        while  inner-loop stop criterion  do
(29)           𝑁 𝑒 𝑖 𝑔 β„Ž 𝑏 π‘œ π‘Ÿ ← Generate( 𝑐 𝑒 π‘Ÿ π‘Ÿ 𝑒 𝑛 𝑑 _ 𝑠 π‘œ 𝑙 𝑒 𝑑 𝑖 π‘œ 𝑛 )
(30)           𝑁 𝑒 𝑖 𝑔 β„Ž 𝑏 π‘œ π‘Ÿ _ 𝑐 π‘œ 𝑠 𝑑 ← Evaluate( 𝑁 𝑒 𝑖 𝑔 β„Ž 𝑏 π‘œ π‘Ÿ )
(31)          if  Accept(current_cost, Neighbor_cost, 𝑇 )  then
(32)             𝑐 𝑒 π‘Ÿ π‘Ÿ 𝑒 𝑛 𝑑 _ 𝑠 π‘œ 𝑙 𝑒 𝑑 𝑖 π‘œ 𝑛 ← 𝑁 𝑒 𝑖 𝑔 β„Ž 𝑏 π‘œ π‘Ÿ
(33)             𝑐 𝑒 π‘Ÿ π‘Ÿ 𝑒 𝑛 𝑑 _ 𝑐 π‘œ 𝑠 𝑑 ← 𝑁 𝑒 𝑖 𝑔 β„Ž 𝑏 π‘œ π‘Ÿ _ 𝑐 π‘œ 𝑠 𝑑
(34)          end
(35)          iterSA ← iterSA + 1
(36)          Update (global_best_solution)
(37)        end
(38)        Update( 𝑇 ) according to Equation(2)
(39)        Update (SA_stop_criterion)
(40)      end
(41)       end
(42)       iter ← iter + 1, Update (stop_criterion)
(43) end