providing genetic algorithm for problems
this algorithm is now in developing mode
finding extermum value of the specific funtion
in tools.py
- get_bin_value() // getting the binary value
- map_binary_value_to_domain() //maping the value of the binary array to the range of the domain
- find_bits_for_accurct() //finiding needs bit for genes in chromosome
- convert_binary_to_gray() //converting binay code to gray code
- conver_gray_to_binary() //converting gray code to binary code
- choice_zero_or_one() //random 0 or 1 value
- choice_int_between_a_and_b() //random int value between [a,b]
- choice_float_between_zero_and_one() //float random value between 0 or 1
- single_point_crossover() //crossover opration
- calculate_roullet_wheel() //random selection
- calculate_searching_space_accurcy() //calculate accuracy of the defined space
in scaling_tool.py:
we provide some scaling tool for scaling the fitness function value
- linear_scaling()
- dynamic_linear_scaling
- pow_scaling
- logarithm_scaling
- nomalization
in GA.py: we defined main class
- Chromosome:
- Generation:
- Genetic:
the parameter that you can tune it:
- number_of_papulation //Number of the papulation for starting
- function //your specific function
- fitness_function //custom fitness function
- domain //input space
- mutation_rate //mutation rate(default is 0)
- crossover_rate//crossover rate (default is 1)
- mutation_bit //number of genes bit that you want to do the mutation oprand
- accurcy //accuracy of the genes value