//Loop through chromosomes in population
for i in range(0,PopSize):
// Return back the search agents that go beyond the boundaries of the search space
ga[i,:]=numpy.clip(ga[i,:], lb, ub)
// Calculate objective function for each search agent
fitness=objf(ga[i,:])
scores[i] = fitness
After Change
bestScore = min(scores)
//Sort from best to worst
ga, scores = sortPopulation(ga, scores)
convergence_curve[l]=bestScore