File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -533,6 +533,13 @@ def run(self):
533533 elif type (self .last_generation_fitness [0 ]) in [list , tuple , numpy .ndarray ]:
534534 # Multi-objective problem.
535535 if self .parent_selection_type in ('nsga3' , 'tournament_nsga3' ):
536+ # The reference points are created before starting the evolution and after the initial fitness is calculated.
537+ # The number of reference points is determined based on:
538+ # 1) The number of divisions (passed by the user).
539+ # 2) The number of objectives (only known after the fitness is calculated).
540+ # In PyGAD, the number of objectives are known only from the length of the returned result of the fitness function.
541+ # This is how NSGA-III knows the number of objectives from the calculated fitness.
542+ # It is time to build the reference points.
536543 self ._bootstrap_nsga3_reference_points ()
537544
538545 best_solution , best_solution_fitness , best_match_idx = self .best_solution (pop_fitness = self .last_generation_fitness )
You can’t perform that action at this time.
0 commit comments