Research Article

Two-Swim Operators in the Modified Bacterial Foraging Algorithm for the Optimal Synthesis of Four-Bar Mechanisms

Algorithm 2

IMBFOA pseudocode. Input parameters are number of bacteria , chemotaxis loop limit , number of bacteria for reproduction , scaling factor , the reproduction cycle RepCycle, the number of cycles , the local search frequency , and for the search direction, and ss for the skew mechanism.
) Create an initial swarm of bacteria by using the skew mechanism   ,  
() Evaluate   ,  
() for to do
() for to do
()    for to do
()       Perform the chemotaxis process by using the two swims in (42) and (43) and the attractor operator in (41) for
         bacteria   by considering the three feasibility rules as selection criteria
()    end
()  end
()  if ( mod RepCycle == 0) then
() Perform the reproduction process by sorting all bacteria in the swarm based on the feasibility rules, duplicating
      the best bacteria and eliminating the remaining
() end
() Perform the elimination-dispersal process by eliminating the worst bacterium in the current swarm
() Update the step size vector with (44)
() if ( mod == 0) then
()  Apply the local search operator (i.e., SQP) to the best bacterium in the swarm. If the obtained bacterium is
      better than the original best bacterium, it takes its place in the swarm.
() end
() end