desdeo_emo.selection
¶
This module provides implementations of various selection operators.
Submodules¶
desdeo_emo.selection.APD_Select
desdeo_emo.selection.APD_Select_constraints
desdeo_emo.selection.IOPIS_APD
desdeo_emo.selection.IOPIS_NSGAIII
desdeo_emo.selection.MOEAD_select
desdeo_emo.selection.NSGAIII_select
desdeo_emo.selection.SelectionBase
desdeo_emo.selection.oAPD
desdeo_emo.selection.robust_APD
desdeo_emo.selection.tournament_select
Package Contents¶
Classes¶
The selection operator for the RVEA algorithm. Read the following paper for more |
|
The MOEAD selection operator. |
Functions¶
|
Tournament selection. Choose number of individuals to participate |
-
class
desdeo_emo.selection.
APD_Select
(pop: desdeo_emo.population.Population.Population, time_penalty_function: Callable, alpha: float = 2, selection_type: str = None)[source]¶ Bases:
desdeo_emo.selection.SelectionBase.SelectionBase
The selection operator for the RVEA algorithm. Read the following paper for more details. R. Cheng, Y. Jin, M. Olhofer and B. Sendhoff, A Reference Vector Guided Evolutionary Algorithm for Many-objective Optimization, IEEE Transactions on Evolutionary Computation, 2016
- Parameters
pop (Population) – The population instance
time_penalty_function (Callable) – A function that returns the time component in the penalty function.
alpha (float, optional) – The RVEA alpha parameter, by default 2
-
do
(self, pop: desdeo_emo.population.Population.Population, vectors: desdeo_emo.utilities.ReferenceVectors.ReferenceVectors) → List[int]¶ Select individuals for mating on basis of Angle penalized distance.
- Parameters
pop (Population) – The current population.
vectors (ReferenceVectors) – Class instance containing reference vectors.
- Returns
List of indices of the selected individuals
- Return type
List[int]
-
_partial_penalty_factor
(self) → float¶ - Calculate and return the partial penalty factor for APD calculation.
This calculation does not include the angle related terms, hence the name. If the calculated penalty is outside [0, 1], it will round it up/down to 0/1
- Returns
The partial penalty value
- Return type
float
-
_calculate_fitness
(self, pop) → numpy.ndarray¶
-
class
desdeo_emo.selection.
NSGAIII_select
(pop: desdeo_emo.population.Population.Population, n_survive: int = None, selection_type: str = None)¶ Bases:
desdeo_emo.selection.SelectionBase.SelectionBase
- The NSGA-III selection operator. Code is heavily based on the version of nsga3 in
the pymoo package by msu-coinlab.
- Parameters
pop (Population) – [description]
n_survive (int, optional) – [description], by default None
-
do
(self, pop: desdeo_emo.population.Population.Population, vectors: desdeo_emo.utilities.ReferenceVectors.ReferenceVectors) → List[int]¶ Select individuals for mating for NSGA-III.
- Parameters
pop (Population) – The current population.
vectors (ReferenceVectors) – Class instance containing reference vectors.
- Returns
List of indices of the selected individuals
- Return type
List[int]
-
get_extreme_points_c
(self, F, ideal_point, extreme_points=None)¶ Taken from pymoo
-
get_nadir_point
(self, extreme_points, ideal_point, worst_point, worst_of_front, worst_of_population)¶
-
niching
(self, F, n_remaining, niche_count, niche_of_individuals, dist_to_niche)¶
-
associate_to_niches
(self, F, ref_dirs, ideal_point, nadir_point, utopian_epsilon=0.0)¶
-
calc_niche_count
(self, n_niches, niche_of_individuals)¶
-
calc_perpendicular_distance
(self, N, ref_dirs)¶
-
_calculate_fitness
(self, pop) → numpy.ndarray¶
-
desdeo_emo.selection.
tour_select
(fitness, tournament_size)[source]¶ Tournament selection. Choose number of individuals to participate and select the one with the best fitness.
- Parameters
fitness (array_like) – An array of each individual’s fitness.
tournament_size (int) – Number of participants in the tournament.
- Returns
The index of the best individual.
- Return type
int
-
class
desdeo_emo.selection.
MOEAD_select
(pop: desdeo_emo.population.Population.Population, SF_type: desdeo_tools.scalarization.MOEADSF.MOEADSFBase)[source]¶ Bases:
desdeo_emo.selection.SelectionBase.SelectionBase
The MOEAD selection operator.
- Parameters
pop (Population) – The population of individuals
SF_type (MOEADSFBase) – The scalarizing function employed to evaluate the solutions
-
do
(self, pop: desdeo_emo.population.Population.Population, vectors: desdeo_emo.utilities.ReferenceVectors.ReferenceVectors, ideal_point, current_neighborhood, offspring_fx) → List[int]¶ Select the individuals that are kept in the neighborhood.
- Parameters
pop (Population) – The current population.
vectors (ReferenceVectors) – Class instance containing reference vectors.
ideal_point – Ideal vector found so far
current_neighborhood – Neighborhood to be updated
offspring_fx – Offspring solution to be compared with the rest of the neighborhood
- Returns
List of indices of the selected individuals
- Return type
List[int]
-
_evaluate_SF
(self, neighborhood, weights, ideal_point)¶