Research Article

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

Algorithm 3

TS-MBFOA pseudocode. Input parameters are number of bacteria , chemotaxis loop limit , scaling stepsize , number of bacteria for reproduction , scaling factor , the reproduction cycle RepCycle, ss for the skew mechanism, and the number of cycles .
) 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 (46) and (47) 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
()Calculated the step size vector with (48)
() end