Skip to main content
. 2022 Feb 9;22(4):1306. doi: 10.3390/s22041306
Algorithm 1: Pseudocode of Jaya.
  • 1:

    Input: Input: objective function (f), Population size (n)

    Number of design variables (m), Lower and Upper bounds (Lb,Ub),

    and Maximum number of iterations (Maxiter)

  • 2:

    Output: best solution and best objective function value

  • 3:

    Initialize the population within lower and upper bounds randomly

  • 4:

    Evaluation of fitness values

  • 5:

    iter = 1

  • 6:

    while iter < Maxiter

  • 7:

    Find the best and worst solution among the current population

  • 8:

           for n = 1 to k do

  • 9:

                for m = 1 to j do

  • 10:

                   Update the solution according to Equation (35)

  • 11:

                  if Xm,n,t < Lb

  • 12:

                      Xm,n,t = Lb

  • 13:

                  else if Xm,n,t > Ub

  • 14:

                      Xm,n,t = Ub

  • 15:

                  else

  • 16:

                       Xm,n,t = Xm,n,t

  • 17:

                  end if

  • 18:

               end for

  • 19:

               if solution f(Xm,n,t) better than f(Xm,n,t)

  • 20:

                  Xm,n,t =Xm,n,t (replace old solution by new solution)

  • 21:

               else

  • 22:

                  Xm,n,t =Xm,n,t (keep old solution)

  • 23:

               end if

  • 24:

           end for

  • 25:

    iter = iter + 1

  • 26:

    end while