You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support of multi-objective optimization using Non-Dominated Sorting Genetic Algorithm II (NSGA-II) using the NSGA2 class in the pygad.utils.nsga2 module. Just return a list, tuple, or numpy.ndarray from the fitness function and the library will consider the problem as multi-objective optimization. All the objectives are expected to be maximization. Check [this section](https://pygad.readthedocs.io/en/latest/pygad_more.html#multi-objective-optimization) for an example.
The parent selection methods and adaptive mutation are edited to support multi-objective optimization.
Two new NSGA-II parent selection methods are supported in the pygad.utils.parent_selection module: 1) Tournament selection for NSGA-II 2) NSGA-II selection.
The plot_fitness() method in the pygad.plot module has a new optional parameter named label to accept the label of the plots. This is only used for multi-objective problems. Otherwise, it is ignored. It defaults to None and accepts a list, tuple, or numpy.ndarray. The labels are used in a legend inside the plot.
The default color in the methods of the pygad.plot module is changed to the greenish #64f20c color.
A new instance attribute named pareto_fronts added to the pygad.GA instances that holds the pareto fronts when solving a multi-objective problem.
The gene_type accepts a list, tuple, or numpy.ndarray for integer data types given that the precision is set to None (e.g. gene_type=[float, [int, None]]).
In the cal_pop_fitness() method, the fitness value is re-used if save_best_solutions=True and the solution is found in the best_solutions attribute. These parameters also can help re-using the fitness of a solution instead of calling the fitness function: keep_elitism, keep_parents, and save_solutions.
The value 99999999999 is replaced by float('inf') in the 2 methods wheel_cumulative_probs() and stochastic_universal_selection() inside the pygad.utils.parent_selection.ParentSelection class.
The plot_result() method in the pygad.visualize.plot.Plot class is removed. Instead, please use the plot_fitness() if you did not upgrade yet.