/Genetic-Algorithm-with-python

using python to realize GA

Primary LanguagePython

Genetic-Algorithm-with-python

See more information about Genetic Algorithm,you can clickhttps://blog.csdn.net/WFRainn/article/details/80458246

Object Function


This is the picture of function:

这里写图片描述

Now we need to find the max value of this function between 0 and 9,accurate it to four decimal places. to be effective, we can use GA to solve it.

Code

GA.py:Run GA in python
utils.py:Save some basic function
selection.py:selection operator
crossover.py:crossover operator
mutation.py:mutation operator


Usage

Run GA.py
You can change the aim function to see if the result are still effective and exact. Also, you can improve my code to achieve higher effect for GA.