Skip to content

SMMousaviSP/genetic_ackley

Repository files navigation

Genetic Algorithm for Ackley Function

In this program, you can test the efficiency of the genetic algorithm on Ackley function.

You can choose the binary chromosome size, the population in each generation, crossover method, parent selection method, survival selection method, probability of selecting a chromosome for mutation, and probability of changing a gene for mutation.

Supported Crossover Methods:

  • n point
  • single point
  • uniform

Supported Parent Selection Methods:

  • Roulette Wheel Selection (RWS)
  • Stochastic Universal Sampling (SUS)
  • Tournament Selection (TS)

Supported Survival Selection Methods:

  • Roulette Wheel Selection (RWS)
  • Stochastic Universal Sampling (SUS)
  • Tournament Selection (TS)
  • Elitism

Average Fitness in Each Iteration

After choosing all of the parameters, the program will show you the best-found answer (the binary chromosome, fitness, x, y, and the output of Ackley function), the best answer in the last iteration, maximum fitness in different iterations plot, and average fitness in different iterations plot.

How to Run

Install required packages in requirements.txt

pip install -r requirements.txt

run cli_app.py file in the app folder

python app/cli_app.py

Releases

No releases published

Packages

No packages published

Languages