desdeo_emo.EAs.BaseEA

Module Contents

Classes

BaseEA

This class provides the basic structure for Evolutionary algorithms.

BaseDecompositionEA

The Base class for decomposition based EAs.

exception desdeo_emo.EAs.BaseEA.eaError[source]

Bases: Exception

Raised when an error related to EA occurs

class desdeo_emo.EAs.BaseEA.BaseEA(a_priori: bool = False, interact: bool = False, selection_operator: Type[desdeo_emo.selection.SelectionBase.SelectionBase] = None, n_iterations: int = 10, n_gen_per_iter: int = 100, total_function_evaluations: int = 0, use_surrogates: bool = False)[source]

This class provides the basic structure for Evolutionary algorithms.

start(self)[source]

Mimics the structure of the mcdm methods. Returns the request objects from self.retuests().

end(self)[source]

To be run at the end of the evolution process.

_next_gen(self)[source]

Run one generation of an EA. Change nothing about the parameters.

iterate(self, preference=None)Tuple[source]

Run one iteration of EA.

One iteration consists of a constant or variable number of generations. This method leaves EA.params unchanged, except the current iteration count and gen count.

continue_iteration(self)[source]

Checks whether the current iteration should be continued or not.

continue_evolution(self)bool[source]

Checks whether the current iteration should be continued or not.

check_FE_count(self)bool[source]
Checks whether termination criteria via function evaluation count has been

met or not.

Returns

True is function evaluation count limit NOT met.

Return type

bool

manage_preferences(self, preference=None)[source]

Run the interruption phase of EA.

Use this phase to make changes to RVEA.params or other objects. Updates Reference Vectors (adaptation), conducts interaction with the user.

requests(self)Tuple[source]
class desdeo_emo.EAs.BaseEA.BaseDecompositionEA(problem: desdeo_problem.MOProblem, selection_operator: Type[desdeo_emo.selection.SelectionBase.SelectionBase] = None, population_size: int = None, population_params: Dict = None, initial_population: desdeo_emo.population.Population.Population = None, a_priori: bool = False, interact: bool = False, n_iterations: int = 10, n_gen_per_iter: int = 100, total_function_evaluations: int = 0, lattice_resolution: int = None, use_surrogates: bool = False)[source]

Bases: BaseEA

The Base class for decomposition based EAs.

This class contains most of the code to set up the parameters and operators. It also contains the logic of a simple decomposition EA.

Parameters
  • problem (MOProblem) – The problem class object specifying the details of the problem.

  • selection_operator (Type[SelectionBase], optional) – The selection operator to be used by the EA, by default None.

  • population_size (int, optional) – The desired population size, by default None, which sets up a default value of population size depending upon the dimensionaly of the problem.

  • population_params (Dict, optional) – The parameters for the population class, by default None. See desdeo_emo.population.Population for more details.

  • initial_population (Population, optional) – An initial population class, by default None. Use this if you want to set up a specific starting population, such as when the output of one EA is to be used as the input of another.

  • lattice_resolution (int, optional) – The number of divisions along individual axes in the objective space to be used while creating the reference vector lattice by the simplex lattice design. By default None

  • a_priori (bool, optional) – A bool variable defining whether a priori preference is to be used or not. By default False

  • interact (bool, optional) – A bool variable defining whether interactive preference is to be used or not. By default False

  • n_iterations (int, optional) – The total number of iterations to be run, by default 10. This is not a hard limit and is only used for an internal counter.

  • n_gen_per_iter (int, optional) – The total number of generations in an iteration to be run, by default 100. This is not a hard limit and is only used for an internal counter.

  • total_function_evaluations (int, optional) – Set an upper limit to the total number of function evaluations. When set to zero, this argument is ignored and other termination criteria are used.

_next_gen(self)[source]

Run one generation of decomposition based EA. Intended to be used by next_iteration.

manage_preferences(self, preference=None)[source]

Run the interruption phase of EA.

Use this phase to make changes to RVEA.params or other objects. Updates Reference Vectors (adaptation), conducts interaction with the user.

_select(self)list[source]

Describe a selection mechanism. Return indices of selected individuals.

Returns

List of indices of individuals to be selected.

Return type

list

request_plot(self)desdeo_tools.interaction.SimplePlotRequest[source]
request_preferences(self)Union[None, Tuple[desdeo_tools.interaction.PreferredSolutionPreference, desdeo_tools.interaction.NonPreferredSolutionPreference, desdeo_tools.interaction.ReferencePointPreference, desdeo_tools.interaction.BoundPreference]][source]
requests(self)Tuple[source]
end(self)[source]

Conducts non-dominated sorting at the end of the evolution process

Returns

The first element is a 2-D array of the decision vectors of the non-dominated solutions.

The second element is a 2-D array of the corresponding objective values.

Return type

tuple