Genetic Algorithm
Genetic Algorithm with floating point gene type in Python.
With options to control console print level.
Contributions/ modifications are highly welcomed.
: Try Online Now Without Any Installations.
Installation
Depends upon numpy for mathematical operations. Install numpy with pip.
pip install numpy
You can control what is printed on console with “LogLevel” value at input.json file.
Accepted: ‘ERROR’, ‘INFO’, ‘DEBUG’
‘ERROR’ : Prints Output Only.
‘INFO’ : Print statistics of all generations.
‘DEBUG’ : Step by step solution for all generations.
Usage example
Navigate to the folder containing main.py. You can just call the main function and it will do the rest.
python main.py
You can customize function at input.py and change the GA parameters at input.json.
You can control selection method with “SelectionType” value at input.json file.
Accepted: ‘RandomSelection’, ‘TournamentSelection’, ‘RankBasedSelection’
‘RandomSelection’ : Random Selection (Default)
‘TournamentSelection’ : Tournament Selection with N/10 members for each group during selection.
‘RankBasedSelection’ : Rank Based Selection
Meta
Sushant Gautam – @eSushant – susant.gautam@gmail.com
Distributed under the MIT license. See LICENSE
for more information.
https://github.com/SushantGautam/GeneticAlgorithm/
Contributing
- Fork it (https://github.com/SushantGautam/GeneticAlgorithm/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request