| @@ 323-335 (lines=13) @@ | ||
| 320 | SelfAdaptiveDifferentialEvolution.setParameters(self, CrossMutt=kwargs.pop('CrossMutt', multiMutations), **kwargs) |
|
| 321 | self.strategies = strategies |
|
| 322 | ||
| 323 | def evolve(self, pop, xb, task, **kwargs): |
|
| 324 | r"""Evolve population with the help multiple mutation strategies. |
|
| 325 | ||
| 326 | Args: |
|
| 327 | pop (numpy.ndarray[Individual]): Current population. |
|
| 328 | xb (Individual): Current best individual. |
|
| 329 | task (Task): Optimization task. |
|
| 330 | **kwargs (Dict[str, Any]): Additional arguments. |
|
| 331 | ||
| 332 | Returns: |
|
| 333 | numpy.ndarray[Individual]: New population of individuals. |
|
| 334 | """ |
|
| 335 | return objects2array([self.CrossMutt(pop, i, xb, self.F, self.CR, self.Rand, task, self.itype, self.strategies) for i in range(len(pop))]) |
|
| 336 | ||
| 337 | class DynNpMultiStrategySelfAdaptiveDifferentialEvolution(MultiStrategySelfAdaptiveDifferentialEvolution, DynNpSelfAdaptiveDifferentialEvolutionAlgorithm): |
|
| 338 | r"""Implementation of Dynamic population size self-adaptive differential evolution algorithm with multiple mutation strategies. |
|
| @@ 859-871 (lines=13) @@ | ||
| 856 | DifferentialEvolution.setParameters(self, CrossMutt=multiMutations, **ukwargs) |
|
| 857 | self.strategies = strategies |
|
| 858 | ||
| 859 | def evolve(self, pop, xb, task, **kwargs): |
|
| 860 | r"""Evolve population with the help multiple mutation strategies. |
|
| 861 | ||
| 862 | Args: |
|
| 863 | pop (numpy.ndarray[Individual]): Current population. |
|
| 864 | xb (Individual): Current best individual. |
|
| 865 | task (Task): Optimization task. |
|
| 866 | **kwargs (Dict[str, Any]): Additional arguments. |
|
| 867 | ||
| 868 | Returns: |
|
| 869 | numpy.ndarray[Individual]: New population of individuals. |
|
| 870 | """ |
|
| 871 | return objects2array([self.CrossMutt(pop, i, xb, self.F, self.CR, self.Rand, task, self.itype, self.strategies) for i in range(len(pop))]) |
|
| 872 | ||
| 873 | class DynNpMultiStrategyDifferentialEvolution(MultiStrategyDifferentialEvolution, DynNpDifferentialEvolution): |
|
| 874 | r"""Implementation of Dynamic population size Differential evolution algorithm with dynamic population size that is defined by the quality of population. |
|