| @@ 811-823 (lines=13) @@ | ||
| 808 | DifferentialEvolution.setParameters(self, CrossMutt=multiMutations, **ukwargs) |
|
| 809 | self.strategies = strategies |
|
| 810 | ||
| 811 | def evolve(self, pop, xb, task, **kwargs): |
|
| 812 | r"""Evolve population with the help multiple mutation strategies. |
|
| 813 | ||
| 814 | Args: |
|
| 815 | pop (numpy.ndarray[Individual]): Current population. |
|
| 816 | xb (Individual): Current best individual. |
|
| 817 | task (Task): Optimization task. |
|
| 818 | **kwargs (Dict[str, Any]): Additional arguments. |
|
| 819 | ||
| 820 | Returns: |
|
| 821 | numpy.ndarray[Individual]: New population of individuals. |
|
| 822 | """ |
|
| 823 | return objects2array([self.CrossMutt(pop, i, xb, self.F, self.CR, self.Rand, task, self.itype, self.strategies) for i in range(len(pop))]) |
|
| 824 | ||
| 825 | class DynNpMultiStrategyDifferentialEvolution(MultiStrategyDifferentialEvolution, DynNpDifferentialEvolution): |
|
| 826 | r"""Implementation of Dynamic population size Differential evolution algorithm with dynamic population size that is defined by the quality of population. |
|
| @@ 313-325 (lines=13) @@ | ||
| 310 | SelfAdaptiveDifferentialEvolution.setParameters(self, CrossMutt=kwargs.pop('CrossMutt', multiMutations), **kwargs) |
|
| 311 | self.strategies = strategies |
|
| 312 | ||
| 313 | def evolve(self, pop, xb, task, **kwargs): |
|
| 314 | r"""Evolve population with the help multiple mutation strategies. |
|
| 315 | ||
| 316 | Args: |
|
| 317 | pop (numpy.ndarray[Individual]): Current population. |
|
| 318 | xb (Individual): Current best individual. |
|
| 319 | task (Task): Optimization task. |
|
| 320 | **kwargs (Dict[str, Any]): Additional arguments. |
|
| 321 | ||
| 322 | Returns: |
|
| 323 | numpy.ndarray[Individual]: New population of individuals. |
|
| 324 | """ |
|
| 325 | return objects2array([self.CrossMutt(pop, i, xb, self.F, self.CR, self.Rand, task, self.itype, self.strategies) for i in range(len(pop))]) |
|
| 326 | ||
| 327 | class DynNpMultiStrategySelfAdaptiveDifferentialEvolution(MultiStrategySelfAdaptiveDifferentialEvolution, DynNpSelfAdaptiveDifferentialEvolutionAlgorithm): |
|
| 328 | r"""Implementation of Dynamic population size self-adaptive differential evolution algorithm with multiple mutation strategies. |
|