Genetic Algorithm

Genetic algorithms simulate the problem to be solved as a biological evolutionary process.
28 download
Aggiornato 6 dic 2022

Visualizza la licenza

The main idea of the genetic algorithm is to borrow from Darwin's evolutionary model under natural selection. By drawing on the theory of biological evolution, the genetic algorithm simulates the problem to be solved into a biological evolution process, generates the next generation of solutions through replication, crossover, mutation and other operations, and gradually eliminates the solution with low fitness function value, and increases the solution with high fitness function value. In this way, after evolving N generations, it is likely to evolve individuals with high fitness function values, which is the optimization result of your objective function value.
1. Let's randomly generate several individuals. (values)
2. Calculate whether these individuals are suitable for the current environment .(the result is not big after bringing in an evaluation function)
3. Record the best individual .(record the local optimal solution)
4. Select and eliminate some individuals according to fitness. (the better the result, the greater the probability of not being thrown away, but I am afraid of the local optimal solution, so there is still a certain probability to be thrown away)
5.Cross-swap the variation. (for example, I have two values: 13 and 15 are OK, and the new two values have to be selected in the 11-17 range)
6. Mutation in the way of gene mutation. (mutation in the range is good, but I am afraid of falling into the local optimal solution, I still have to occasionally engage in some large mutation, even if it is a bad mutation)
7.Moving on to the next cycle, recalculate the degree of adaptation to the current environment and continue the previous series of steps.
8. After many generations (the number of iterations is greater than our setting), the best one of the best solutions for each round of the record is output.
Compatibilità della release di MATLAB
Creato con R2022b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Tag Aggiungi tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versione Pubblicato Note della release
1.0.0