Skip to content

theDiverDK/GeneticAlgorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Genetic Algorithm

A Python learning project that evolves a population toward a target using a simple genetic algorithm. The included example uses a string model and demonstrates the typical evaluate, select, crossover, and mutate cycle.

How it works

test.py creates a Network with a population of string models, then iterates through generations until the target fitness is reached or the generation limit is exhausted. The model and algorithm implementation live under GeneticAlgorithm/.

Run the example

python3 test.py

The example prints the best fitness value for each generation and then outputs the final result.

Project layout

  • GeneticAlgorithm/Network.py — genetic algorithm orchestration.
  • GeneticAlgorithm/Models/BaseModel.py — base model abstraction.
  • GeneticAlgorithm/Models/StringModel.py — string-based example model.
  • test.py — runnable example.

License

See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages