guofei9987 / scikit-opt

Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Optimization Algorithm,Immune Algorithm, Artificial Fish Swarm Algorithm, Differential Evolution and TSP(Traveling salesman)
https://scikit-opt.github.io/scikit-opt/#/en/
MIT License
5.3k stars 989 forks source link

Update GA.py to add class EGA to achieve GA with elitist machine #219

Closed waterfall-xi closed 1 year ago

waterfall-xi commented 1 year ago

define class EGA from GA;

self._n_elitist = n_elitist in __init__();

redefine run() in EGA, in each iteration, isolate top n fitted elitists out from population, add them back after selection(), crossover() and mutation().