Skip to main content
. 2025 Jun 29;10(7):421. doi: 10.3390/biomimetics10070421
Algorithm 2 Self-learning operation
  • Require: 

    CBestt+2/3∈Rn: initial solution

  • Ensure: 

    CBestt+1∈Rn: result solution

  •     1:

    CurrentSolution ← CBestt+2/3

  •     2:

    CurrentFitness ← Fitness(CurrentSolution)

  •     3:

    while stop condition not meet do

  •     4:

        Neighbors ← GenerateNeighbors(CurrentSolution)

  •     5:

        BestFitness ← CurrentFitness

  •     6:

        for Neighbor in Neighbors do

  •     7:

            NeighborFitness ← Fitness(Neighbor)

  •     8:

            if NeighborFitness > BestFitness then

  •     9:

                 BestNeighbor ← Neighbor

  •   10:

               BestFitness ← NeighborFitness

  •   11:

            end if

  •   12:

        end for

  •   13:

        if BestFitness > CurrentFitness then

  •   14:

            CurrentSolution ← BestNeighbor

  •   15:

            CurrentFitness ← BestFitness

  •   16:

        else

  •   17:

            break

  •   18:

        end if

  •   19:

    end while

  •   20:

    CBestt+1 ← CurrentSolution

  •   21:

    Return  CBestt+1