GeneticAlgorithmPython icon indicating copy to clipboard operation
GeneticAlgorithmPython copied to clipboard

[PR] add args parameter for GA class

Open qelloman opened this issue 4 years ago • 0 comments

Related Issue

#71

Description

  • Previously, fitness_func takes only two arguments: solution and solution index. If extra parameters are required for the fitness_func, we are forced to use global parameters as shown in 'example.py', which is inconvenient.
  • Like scipy.optimize.differential_evolution, a new parameter, args, is added to GA class.
  • Tuple args is passed to fitness_func so it can use fixed parameters. => fitness_func(solution, solution_idx, args)

qelloman avatar Oct 22 '21 22:10 qelloman