Skip to main content
. 2026 Jan 6;11(1):43. doi: 10.3390/biomimetics11010043
Algorithm 2 The CTWRBMO
1: Begin
2: Initialize the relevant parameters (T, N, ε, wd, etc.)
3: Initialize population using Circle chaotic map (Equation (7))
4: Evaluate initial fitness of all individuals
5: Set global best Xbest← best initial solution
6:      while t < T
7: Calculate the fitness of each search agent
8:                 Update global best solution Xbest  if improved
9:                 Dynamically update ε by (8)
10:                 Dynamically updated wd by (9)
11:                 Exploration:
12:                      if rand < ε
13:                              Generate candidate Xfood_i using Equation (10)
14:                      Else
15:                              Generate candidate Xfood_i using Equation (11)
16:                      end if
17:                 Exploitation:
18:                      if rand < ε
19:                              Update red-billed blue magpie position using Equation (13)
20:                      Else
21:                              Update red-billed blue magpie position using Equation (14)
22:                      end if
23:                      Apply greedy selection by Equation (12)
24:                      Update Xbest if new solution is better
25:      end while
26:      Return global best solution Xbest
27: end