Skip to main content
. 2021 Oct 7;21(19):6654. doi: 10.3390/s21196654
Algorithm 2 Proposed eHHO pseudo-code
  • Inputs: The population size N and maximum FFEs number (maxFFE)

  • Initialize population Xi, (i=1,2,3,N) according to Algorithm 1

  • Initialize FFEs=0

  • whileFFEsmaxFFEsdo

  •  Calculate the fitness values of all individuals

  •  Set Xbest as the location of current best solution

  • for each solution Xi do

  •   Update the initial energy E0 and jump strength J

  •   Update E

  •   if |E|1 then

  •    Exploration phase

  •    Update the location vector

  •   end if

  •   if |E|<1 then

  •    Exploitation phase

  •    if r0.5 and |E|0.5 then

  •     Soft besiege

  •     Update the location vector by soft besiege

  •    else if r0.5 and |E|<0.5 then

  •     Hard besiege

  •     Update the location vector by using hard besiege

  •    else if r<0.5 and |E|0.5 then

  •     Soft besiege with progressive rapid dives

  •     Update the location vector by using soft besiege with rapid dives

  •    else if r<0.5 and |E|<0.5 then

  •     Hard besiege with progressive rapid dives

  •     Update the location vector using hard besiege with progressive rapid dives

  •    end if

  •   end if

  • end for

  • if ψ<FFEs then

  •   Generate Xbestqr

  •   Perform greedy selection between Xworst and Xbestqr

  • else if ψt and k<bt then

  •   Generate Xbestqr

  •   Perform greedy selection between Xbest and Xbestqr

  • else

  •   Generate Xbestc

  •   Perform greedy selection between Xbest and Xbestc

  • end if

  • end while

  • Return Xbest

  • Post-process results and visualization