@@ 366-378 (lines=13) @@ | ||
363 | SelfAdaptiveDifferentialEvolution.setParameters(self, CrossMutt=kwargs.pop('CrossMutt', multiMutations), **kwargs) |
|
364 | self.strategies = strategies |
|
365 | ||
366 | def evolve(self, pop, xb, task, **kwargs): |
|
367 | r"""Evolve population with the help multiple mutation strategies. |
|
368 | ||
369 | Args: |
|
370 | pop (numpy.ndarray[Individual]): Current population. |
|
371 | xb (Individual): Current best individual. |
|
372 | task (Task): Optimization task. |
|
373 | **kwargs (Dict[str, Any]): Additional arguments. |
|
374 | ||
375 | Returns: |
|
376 | numpy.ndarray[Individual]: New population of individuals. |
|
377 | """ |
|
378 | return objects2array([self.CrossMutt(pop, i, xb, self.F, self.CR, self.Rand, task, self.itype, self.strategies) for i in range(len(pop))]) |
|
379 | ||
380 | class DynNpMultiStrategySelfAdaptiveDifferentialEvolution(MultiStrategySelfAdaptiveDifferentialEvolution, DynNpSelfAdaptiveDifferentialEvolutionAlgorithm): |
|
381 | r"""Implementation of Dynamic population size self-adaptive differential evolution algorithm with multiple mutation strategies. |
@@ 920-932 (lines=13) @@ | ||
917 | d.update({'strategies': self.strategies}) |
|
918 | return d |
|
919 | ||
920 | def evolve(self, pop, xb, task, **kwargs): |
|
921 | r"""Evolve population with the help multiple mutation strategies. |
|
922 | ||
923 | Args: |
|
924 | pop (numpy.ndarray): Current population. |
|
925 | xb (numpy.ndarray): Current best individual. |
|
926 | task (Task): Optimization task. |
|
927 | **kwargs (Dict[str, Any]): Additional arguments. |
|
928 | ||
929 | Returns: |
|
930 | numpy.ndarray: New population of individuals. |
|
931 | """ |
|
932 | return objects2array([self.CrossMutt(pop, i, xb, self.F, self.CR, self.Rand, task, self.itype, self.strategies) for i in range(len(pop))]) |
|
933 | ||
934 | class DynNpMultiStrategyDifferentialEvolution(MultiStrategyDifferentialEvolution, DynNpDifferentialEvolution): |
|
935 | r"""Implementation of Dynamic population size Differential evolution algorithm with dynamic population size that is defined by the quality of population. |