Skip to main content
. 2020 Apr 30;20(9):2566. doi: 10.3390/s20092566
Algorithm 4 Pseudocode of the mutation operator.
function Mutation(Q,Pm)
  Q
  for all {x}Qdo             ▹ all the individuals in Q
   xx
   for i1,L do  ▹i goes from 1 to L (the length of the solution vector)
    if rnd()<Pm then            ▹ mutation probability
     MrandInt(1,10)
     ΔgetDelta(x[i],M)
     if rnd()<0.5 then           ▹ increment/decrement
      Δ=1Δ
     end if
     x[i]x[i]+Δ
    end if
   end for
   QQ{x}
  end for
  return Q
end function