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.27k stars 991 forks source link

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

Closed waterfall-xi closed 11 months 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().