Seems like an inaccuracy that was left out because there was no actual instance of population based_metaheuristic_implemented yet.
Current population should not be a TargetSolution instance but a list of TargetSolutions.
if not isinstance(value, TargetSolution) and value is not None:
raise TypeError('Parameter \'current_population\' must have type \'list[TargetSolution]\' or be None.')
self.__current_population = value
if (not isinstance(value, list) or (isinstance(value,list) and not all(isinstance(x, TargetSolution) for x in value))) and value is not None:
raise TypeError('Parameter \'current_population\' must have type \'list[TargetSolution]\' or be None.')
self.__current_population = value
Seems like an inaccuracy that was left out because there was no actual instance of population based_metaheuristic_implemented yet. Current population should not be a TargetSolution instance but a list of TargetSolutions.
Current code:
@current_population.setter def current_population(self, value:Optional[list[TargetSolution]])->None:
This is what i suggest:
@current_population.setter def current_population(self, value:Optional[list[TargetSolution]])->None: