Skip to main content
. 2025 Jun 29;10(7):420. doi: 10.3390/biomimetics10070420
Algorithm 2: ECFDBO (Environment-aware Chaotic Force-field Dung Beetle Optimizer)
Input: population size: N; problem dimension: d; search boundary: [lb, ub]; maximum number of iterations: Tmax; fitness function: f(x)
Output: Optimal position: Xbest
1:      Initialize {Xi}₁ⁿ ∼ Uniform (lb, ub)
2:      Evaluate fi, set Xbest
3:      for t = 1…Tmax do
4:                  // Construct the set of suboptimal solutions Q
5:                  Sort {Xi} by fitness, let Q ← best K = max (3, ⌊0.1·N⌋)
6:                  for each i = 1…N do
7:                        Compute
8:                                  Fi ← Fg − Fr← Calculated using Equation (14)
9:                              if rand () < pm then
10:                                  η ←Calculated using Equation (15)
11:                                  Xi ←Attraction–Repulsion Mutation
12:                             else
13:                                    // Chaos Steps Update
14:                                    Xi ← Calculated using Equation (9)
15:                             end if
16:                             Xi ← SmartReflect(Xi, lb, ub, ε) ← Calculated using Equation (12)
17:                 end for
18:                 {Xi}← DBO_ Stage({Xi})      // Rolling, Reproduction, Foraging, Stealing
19:                 Evaluate all fi, update Xbest
20:    end for
21:    return Xbest