for greater diversity. At this stage, it’s not a question of finding the right solution. It’s
all about identifying enough solutions capable of responding to the problem. In fact,
the more varied the initial population, the more likely it is that the best possible
solutions can be devised.
Then we will Encode of chromosomes, The process can be performed using bits,
numbers, trees, arrays, lists or any other objects.
In binary encoding, every chromosome is a string of bits (0 or 1), Once the problem is
encoded in a chromosomal manner, then we choose fitness measure for discriminating
good solutions from bad ones has been chosen.
-------------------------------------------------------------------------------------------------
2- Fitness Function
Once the population has been created, it’s time to fitness measures for discriminating
against good solutions from bad, we evaluate each individual according to his or her
ability to solve the problem. This phase of the genetic algorithm is complex, as it is
sometimes difficult to compare two individuals with each other in particularly true for
multi-criteria problems, where the optimal solution depends on several parameters,
without one being better than the other.
In every iteration, the individuals are evaluated based on their fitness scores which are
computed by the fitness function. Individuals who achieve a better fitness score
represent better solutions and are more likely to be chosen to crossover and passed on
to the next generation.
In summary, the fitness function in genetic algorithms is a measure of the quality or
suitability of a potential solution.
-------------------------------------------------------------------------------------------------
In this work, because the variables aren't related to each other and it is difficult to find
an easy way to calculate the fitness function, this stage was implemented by
Distributed Evolutionary Algorithms in Python (DEAP) framework. Framework
DEAP is a powerful evolutionary computation framework in Python designed for
rapid prototyping and testing of genetic algorithms (GA), genetic programming (GP),
and other evolutionary optimization techniques, where it provides tools to implement
evolutionary algorithms efficiently. It can easily calculate the fitness function and
combine variables to calculate the best possible solutions.
-------------------------------------------------------------------------------------------------
3- Selection
Selection of individuals for the next generation, either to reproduce or to live on,
relies heavily on the evaluation function. How heavily is dependent on which
selection technique you use. It allocates more copies of those solutions with higher
fitness values and thus imposes the survival-of-the-fittest mechanism on the candidate
solutions. The main idea of selection is to prefer better solutions to worse ones, and
many selection Ways to accomplish this idea, including: