EMO Pydantic Interface
This page documents the Pydantic interfaces for configuring Evolutionary Multi-Objective Optimization (EMO)
algorithms in DESDEO. Essentially, create a complete EMOOptions model by specifying options for
the various components of the algorithm. Pass the created model, along with the problem to be solved, to
emo_constructor to create an instance of the desired algorithm.
Popular pre-configured EMO methods include NSGA-III,
RVEA, and IBEA.
You can find the actual implementation of these components in the
EMO page.
Algorithms
Define popular MOEAs as Pydantic models.
ibea_mixed_integer_options
Get default IBEA options for mixed integer problems as a Pydantic model.
References
Zitzler, E., Künzli, S. (2004). Indicator-Based Selection in Multiobjective Search. In: Yao, X., et al. Parallel Problem Solving from Nature - PPSN VIII. PPSN 2004. Lecture Notes in Computer Science, vol 3242. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30217-9_84
Returns:
| Name | Type | Description |
|---|---|---|
EMOOptions |
EMOOptions
|
The default IBEA mixed integer options as a Pydantic model |
Source code in desdeo/emo/options/algorithms.py
ibea_options
Get default IBEA options as a Pydantic model.
References
Zitzler, E., Künzli, S. (2004). Indicator-Based Selection in Multiobjective Search. In: Yao, X., et al. Parallel Problem Solving from Nature - PPSN VIII. PPSN 2004. Lecture Notes in Computer Science, vol 3242. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30217-9_84
Returns:
| Name | Type | Description |
|---|---|---|
EMOOptions |
EMOOptions
|
The default IBEA options as a Pydantic model. |
Source code in desdeo/emo/options/algorithms.py
nsga2_options
Get default NSGA-II options as a Pydantic model.
Deb, K., Pratap, A., Agarwal, S., & Meyarivan, T. A. M. T.
(2002). A fast and elitist multiobjective genetic algorithm: NSGA-II. IEEE transactions on evolutionary computation, 6(2), 182-197.
Returns:
| Name | Type | Description |
|---|---|---|
EMOOptions |
EMOOptions
|
The default NSGA-II options as a Pydantic model. |
Source code in desdeo/emo/options/algorithms.py
nsga3_mixed_integer_options
Get default NSGA3 options for mixed integer problems as a Pydantic model.
References
K. Deb and H. Jain, “An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I: Solving Problems With Box Constraints,” IEEE Transactions on Evolutionary Computation, vol. 18, no. 4, pp. 577-601, Aug. 2014.
J. Hakanen, T. Chugh, K. Sindhya, Y. Jin, and K. Miettinen, “Connections of reference vectors and different types of preference information in interactive multiobjective evolutionary algorithms,” in 2016 IEEE Symposium Series on Computational Intelligence (SSCI), Athens, Greece: IEEE, Dec. 2016, pp. 1-8.
Returns:
| Name | Type | Description |
|---|---|---|
EMOOptions |
EMOOptions
|
The default NSGA3 mixed integer options as a Pydantic model |
Source code in desdeo/emo/options/algorithms.py
nsga3_options
Get default NSGA-III options as a Pydantic model.
References
K. Deb and H. Jain, “An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I: Solving Problems With Box Constraints,” IEEE Transactions on Evolutionary Computation, vol. 18, no. 4, pp. 577-601, Aug. 2014.
J. Hakanen, T. Chugh, K. Sindhya, Y. Jin, and K. Miettinen, “Connections of reference vectors and different types of preference information in interactive multiobjective evolutionary algorithms,” in 2016 IEEE Symposium Series on Computational Intelligence (SSCI), Athens, Greece: IEEE, Dec. 2016, pp. 1-8.
Returns:
| Name | Type | Description |
|---|---|---|
EMOOptions |
EMOOptions
|
The default NSGA-III options as a Pydantic model. |
Source code in desdeo/emo/options/algorithms.py
rvea_mixed_integer_options
Get default RVEA options for mixed integer problems as a Pydantic model.
References
R. Cheng, Y. Jin, M. Olhofer and B. Sendhoff, "A Reference Vector Guided Evolutionary Algorithm for Many- Objective Optimization," in IEEE Transactions on Evolutionary Computation, vol. 20, no. 5, pp. 773-791, Oct. 2016, doi: 10.1109/TEVC.2016.2519378.
J. Hakanen, T. Chugh, K. Sindhya, Y. Jin, and K. Miettinen, “Connections of reference vectors and different types of preference information in interactive multiobjective evolutionary algorithms,” in 2016 IEEE Symposium Series on Computational Intelligence (SSCI), Athens, Greece: IEEE, Dec. 2016, pp. 1-8.
Returns:
| Name | Type | Description |
|---|---|---|
EMOOptions |
EMOOptions
|
The default RVEA mixed integer options as a Pydantic model |
Source code in desdeo/emo/options/algorithms.py
rvea_options
Get default Reference Vector Guided Evolutionary Algorithm (RVEA) options as a Pydantic model.
References
R. Cheng, Y. Jin, M. Olhofer and B. Sendhoff, "A Reference Vector Guided Evolutionary Algorithm for Many- Objective Optimization," in IEEE Transactions on Evolutionary Computation, vol. 20, no. 5, pp. 773-791, Oct. 2016, doi: 10.1109/TEVC.2016.2519378.
J. Hakanen, T. Chugh, K. Sindhya, Y. Jin, and K. Miettinen, “Connections of reference vectors and different types of preference information in interactive multiobjective evolutionary algorithms,” in 2016 IEEE Symposium Series on Computational Intelligence (SSCI), Athens, Greece: IEEE, Dec. 2016, pp. 1-8.
Returns:
| Name | Type | Description |
|---|---|---|
EMOOptions |
EMOOptions
|
The default RVEA options as a Pydantic model. |
Source code in desdeo/emo/options/algorithms.py
Templates
JSON Schema for template options.
BaseTemplateOptions
Bases: BaseModel
Base class for template options.
Source code in desdeo/emo/options/templates.py
repair
class-attribute
instance-attribute
The repair operator options.
seed
class-attribute
instance-attribute
The seed for random number generation.
use_archive
class-attribute
instance-attribute
Whether to use an archive.
ConstructorExtras
dataclass
Extra information returned by the emo_constructor.
Source code in desdeo/emo/options/templates.py
archive
instance-attribute
The archive associated with the current solver, if any.
problem
instance-attribute
New problem generated by the constructor (e.g. to handle preferences via IOPIS). If no new problem is generated, the original problem is returned.
DesirableRangesOptions
Bases: BaseModel
Options for providing desirable ranges for an EA.
Source code in desdeo/emo/options/templates.py
aspiration_levels
class-attribute
instance-attribute
aspiration_levels: dict[str, float] = Field(
description="The aspiration levels as a dictionary with objective function symbols as the keys."
)
The aspiration levels as a dictionary with objective function symbols as the keys.
method
class-attribute
instance-attribute
method: Literal["Hakanen", "DF transformation"] = Field(
default="Hakanen",
description="The method for handling the desirable ranges.",
)
The method for handling the desirable ranges.
EMOOptions
Bases: BaseModel
Options for configuring the EMO algorithm.
Source code in desdeo/emo/options/templates.py
InvalidTemplateError
NonPreferredSolutionsOptions
Bases: BaseModel
Options for providing non-preferred solutions for an EA.
Source code in desdeo/emo/options/templates.py
method
class-attribute
instance-attribute
method: Literal["Hakanen"] = Field(
default="Hakanen",
description="The method for handling the non-preferred solutions.",
)
The method for handling the non-preferred solutions.
PreferredSolutionsOptions
Bases: BaseModel
Options for providing preferred solutions for an EA.
Source code in desdeo/emo/options/templates.py
method
class-attribute
instance-attribute
method: Literal["Hakanen"] = Field(
default="Hakanen",
description="The method for handling the preferred solutions.",
)
The method for handling the preferred solutions.
ReferencePointOptions
Bases: BaseModel
Options for providing a reference point for an EA.
Source code in desdeo/emo/options/templates.py
method
class-attribute
instance-attribute
method: Literal["Hakanen", "IOPIS"] = Field(
default="Hakanen",
description="The method for handling the reference point.",
)
The method for handling the reference point.
Template1Options
Bases: BaseTemplateOptions
Options for template 1.
Template 1 is used by methods such as NSGA-III and RVEA. See template1 for more details.
Source code in desdeo/emo/options/templates.py
Template2Options
Bases: BaseTemplateOptions
Options for template 2.
Template 2 is used by methods such as IBEA. See template2 for more details.
Source code in desdeo/emo/options/templates.py
emo_constructor
emo_constructor(
emo_options: EMOOptions,
problem: Problem,
external_check: Callable[[], bool] | None = None,
) -> tuple[Callable[[], EMOResult], ConstructorExtras]
Construct an evolutionary algorithm from the given options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
emo_options
|
EMOOptions
|
The options for the EMO algorithm. |
required |
problem
|
Problem
|
The optimization problem to solve. |
required |
external_check
|
Callable[[], bool] | None
|
A callable that returns True if the algorithm should stop, False otherwise. By default, None. |
None
|
Returns:
| Type | Description |
|---|---|
Callable[[], EMOResult]
|
tuple[Callable[[], EMOResult], ConstructorExtras]: A tuple containing the template function |
ConstructorExtras
|
and extra information such as the (possibly modified) problem, publisher, and archive. Run the template |
tuple[Callable[[], EMOResult], ConstructorExtras]
|
function to execute the algorithm. |
Raises:
| Type | Description |
|---|---|
InvalidTemplateError
|
If the template configuration is invalid. |
Source code in desdeo/emo/options/templates.py
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | |
preference_handler
preference_handler(
preference: PreferenceOptions | None,
problem: Problem,
selection: SelectorOptions,
) -> tuple[Problem, SelectorOptions]
Handle the preference options for the EMO algorithm.
This function modifies the problem and selection operator based on the provided preference options. E.g., if the preference method is "Hakanen", the reference vector options of the selection operator are modified to include the preference information. If the preference method is "IOPIS" or "DF transformation", the problem is modified to include desirability functions or IOPIS functions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preference
|
PreferenceOptions | None
|
The preference options. |
required |
problem
|
Problem
|
The optimization problem. |
required |
selection
|
SelectorOptions
|
The selection operator options. |
required |
Returns:
| Type | Description |
|---|---|
tuple[Problem, SelectorOptions]
|
tuple[Problem, SelectorOptions]: The (modified, if necessary) problem and selection operator options. |
Raises:
| Type | Description |
|---|---|
InvalidTemplateError
|
If the preference handling method is incompatible with the selection operator. |
Source code in desdeo/emo/options/templates.py
Crossover Operators
JSON Schema for crossover operator options.
BlendAlphaCrossoverOptions
Bases: BaseModel
Options for Blend Alpha Crossover.
Source code in desdeo/emo/options/crossover.py
alpha
class-attribute
instance-attribute
alpha: float = Field(
default=0.5,
ge=0.0,
description="Non-negative blending factor 'alpha' that controls the extent to which offspring may be sampled outside the interval defined by each pair of parent genes. alpha = 0 restricts children strictly within the parents range, larger alpha allows some outliers.",
)
Non-negative blending factor 'alpha' that controls the extent to which offspring may be sampled outside the interval defined by each pair of parent genes. alpha = 0 restricts children strictly within the parents range, larger alpha allows some outliers.
BoundedExponentialCrossoverOptions
Bases: BaseModel
Options for Bounded Exponential Crossover.
Source code in desdeo/emo/options/crossover.py
lambda_
class-attribute
instance-attribute
lambda_: float = Field(
default=1.0,
gt=0.0,
description="Positive scale λ for the exponential distribution.",
)
Positive scale λ for the exponential distribution.
LocalCrossoverOptions
Bases: BaseModel
Options for Local Crossover.
Source code in desdeo/emo/options/crossover.py
SimulatedBinaryCrossoverOptions
Bases: BaseModel
Options for Simulated Binary Crossover (SBX).
Source code in desdeo/emo/options/crossover.py
name
class-attribute
instance-attribute
name: Literal["SimulatedBinaryCrossover"] = Field(
default="SimulatedBinaryCrossover",
frozen=True,
description="The name of the crossover operator.",
)
The name of the crossover operator.
SingleArithmeticCrossoverOptions
Bases: BaseModel
Options for Single Arithmetic Crossover.
Source code in desdeo/emo/options/crossover.py
SinglePointBinaryCrossoverOptions
Bases: BaseModel
Options for Single Point Binary Crossover.
Source code in desdeo/emo/options/crossover.py
UniformIntegerCrossoverOptions
Bases: BaseModel
Options for Uniform Integer Crossover.
Source code in desdeo/emo/options/crossover.py
UniformMixedIntegerCrossoverOptions
Bases: BaseModel
Options for Uniform Mixed Integer Crossover.
Source code in desdeo/emo/options/crossover.py
crossover_constructor
crossover_constructor(
problem: Problem,
publisher: Publisher,
seed: int,
verbosity: int,
options: CrossoverOptions,
) -> BaseCrossover
Construct a crossover operator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
problem
|
Problem
|
The optimization problem to solve. |
required |
publisher
|
Publisher
|
The publisher for communication. |
required |
seed
|
int
|
The random seed for reproducibility. |
required |
verbosity
|
int
|
The verbosity level of the output. |
required |
options
|
CrossoverOptions
|
The options for the crossover operator. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
BaseCrossover |
BaseCrossover
|
The constructed crossover operator. |
Source code in desdeo/emo/options/crossover.py
Generator Operators
JSON Schema for generator options.
ArchiveGeneratorOptions
Bases: BaseModel
Options for Archive generator.
Source code in desdeo/emo/options/generator.py
name
class-attribute
instance-attribute
The name of the generator.
BaseGeneratorOptions
Bases: BaseModel
Options for all generators.
Source code in desdeo/emo/options/generator.py
LHSGeneratorOptions
Bases: BaseGeneratorOptions
Options for Latin Hypercube Sampling (LHS) generator.
Source code in desdeo/emo/options/generator.py
RandomBinaryGeneratorOptions
Bases: BaseGeneratorOptions
Options for Random Binary generator.
Source code in desdeo/emo/options/generator.py
RandomGeneratorOptions
Bases: BaseGeneratorOptions
Options for Random generator.
Source code in desdeo/emo/options/generator.py
RandomIntegerGeneratorOptions
Bases: BaseGeneratorOptions
Options for Random Integer generator.
Source code in desdeo/emo/options/generator.py
RandomMixedIntegerGeneratorOptions
Bases: BaseGeneratorOptions
Options for Random Mixed Integer generator.
Source code in desdeo/emo/options/generator.py
SeededHybridGeneratorOptions
Bases: BaseGeneratorOptions
Options for the seeded hybrid generator.
Source code in desdeo/emo/options/generator.py
flip_prob
class-attribute
instance-attribute
The flipping probability when perturbing binary variables.
perturb_fraction
class-attribute
instance-attribute
The desired fraction of perturbed vs random solutions in the generated population.
seed_solution
instance-attribute
A dataframe with a single row representing the solution seed. The columns must math the symbols of the variables in the problem being solved.
generator_constructor
generator_constructor(
problem: Problem,
options: GeneratorOptions,
publisher: Publisher,
verbosity: int,
seed: int,
evaluator: EMOEvaluator,
) -> BaseGenerator
Construct a generator based on the provided options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
problem
|
Problem
|
The optimization problem to solve. |
required |
options
|
GeneratorOptions
|
The options for the generator. |
required |
publisher
|
Publisher
|
The publisher for the generator. |
required |
verbosity
|
int
|
The verbosity level for the generator. |
required |
seed
|
int
|
The random seed for the generator. |
required |
evaluator
|
EMOEvaluator
|
The evaluator to use for evaluating solutions. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
BaseGenerator |
BaseGenerator
|
The constructed generator. |
Source code in desdeo/emo/options/generator.py
Mutation Operators
JSON Schema for mutation operator options.
MutationOptions
module-attribute
MutationOptions = (
BoundedPolynomialMutationOptions
| BinaryFlipMutationOptions
| IntegerRandomMutationOptions
| MixedIntegerRandomMutationOptions
| MPTMutationOptions
| NonUniformMutationOptions
| SelfAdaptiveGaussianMutationOptions
| PowerMutationOptions
)
All possible mutation operator options.
BinaryFlipMutationOptions
Bases: BaseModel
Options for Binary Flip Mutation.
Source code in desdeo/emo/options/mutation.py
mutation_probability
class-attribute
instance-attribute
mutation_probability: float | None = Field(
default=None,
ge=0.0,
le=1.0,
description="The probability of mutation. Defaults to None, which sets the mutation probability to 1/<number of decision variables>.",
)
The probability of mutation. Defaults to None, which sets the mutation probability to
1/
BoundedPolynomialMutationOptions
Bases: BaseModel
Options for Bounded Polynomial Mutation.
Source code in desdeo/emo/options/mutation.py
distribution_index
class-attribute
instance-attribute
The distribution index.
mutation_probability
class-attribute
instance-attribute
The probability of mutation. Defaults to None, which sets the mutation probability to
1/
IntegerRandomMutationOptions
Bases: BaseModel
Options for Integer Random Mutation.
Source code in desdeo/emo/options/mutation.py
mutation_probability
class-attribute
instance-attribute
mutation_probability: float | None = Field(
default=None,
ge=0.0,
le=1.0,
description="The probability of mutation. Defaults to None, which sets the mutation probability to 1/<number of decision variables>.",
)
The probability of mutation. Defaults to None, which sets the mutation probability to
1/
MPTMutationOptions
Bases: BaseModel
Options for MPT Mutation.
Source code in desdeo/emo/options/mutation.py
mutation_exponent
class-attribute
instance-attribute
mutation_exponent: float = Field(
default=2.0,
ge=0.0,
description="Controls strength of small mutation (larger means smaller mutations).",
)
Controls strength of small mutation (larger means smaller mutations).
mutation_probability
class-attribute
instance-attribute
mutation_probability: float | None = Field(
default=None,
ge=0.0,
le=1.0,
description="The probability of mutation. Defaults to None, which sets the mutation probability to 1/<number of decision variables>.",
)
The probability of mutation. Defaults to None, which sets the mutation probability to
1/
MixedIntegerRandomMutationOptions
Bases: BaseModel
Options for Mixed Integer Random Mutation.
Source code in desdeo/emo/options/mutation.py
mutation_probability
class-attribute
instance-attribute
mutation_probability: float | None = Field(
default=None,
ge=0.0,
le=1.0,
description="The probability of mutation. Defaults to None, which sets the mutation probability to 1/<number of decision variables>.",
)
The probability of mutation. Defaults to None, which sets the mutation probability to
1/
NonUniformMutationOptions
Bases: BaseModel
Options for Non-Uniform Mutation.
Source code in desdeo/emo/options/mutation.py
b
class-attribute
instance-attribute
b: float = Field(
default=5.0,
ge=0.0,
description="Non-uniform mutation decay parameter. Higher values causefaster reduction in mutation strength over generations.",
)
Non-uniform mutation decay parameter. Higher values cause faster reduction in mutation strength over generations.
mutation_probability
class-attribute
instance-attribute
mutation_probability: float | None = Field(
default=None,
ge=0.0,
le=1.0,
description="The probability of mutation. Defaults to None, which sets the mutation probability to 1/<number of decision variables>.",
)
The probability of mutation. Defaults to None, which sets the mutation probability to
1/
PowerMutationOptions
Bases: BaseModel
Options for Power Mutation.
Source code in desdeo/emo/options/mutation.py
mutation_probability
class-attribute
instance-attribute
mutation_probability: float | None = Field(
default=None,
ge=0.0,
le=1.0,
description="The probability of mutation. Defaults to None, which sets the mutation probability to 1/<number of decision variables>.",
)
The probability of mutation. Defaults to None, which sets the mutation probability to
1/
SelfAdaptiveGaussianMutationOptions
Bases: BaseModel
Options for Self-Adaptive Gaussian Mutation.
Source code in desdeo/emo/options/mutation.py
mutation_probability
class-attribute
instance-attribute
mutation_probability: float | None = Field(
default=None,
ge=0.0,
le=1.0,
description="The probability of mutation. Defaults to None, which sets the mutation probability to 1/<number of decision variables>.",
)
The probability of mutation. Defaults to None, which sets the mutation probability to
1/
mutation_constructor
mutation_constructor(
problem: Problem,
publisher: Publisher,
seed: int,
verbosity: int,
options: MutationOptions,
) -> BaseMutation
Construct a mutation operator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
problem
|
Problem
|
The optimization problem to solve. |
required |
publisher
|
Publisher
|
The publisher for communication. |
required |
seed
|
int
|
The random seed for reproducibility. |
required |
verbosity
|
int
|
The verbosity level of the output. |
required |
options
|
MutationOptions
|
The options for the mutation operator. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
BaseCrossover |
BaseMutation
|
The constructed crossover operator. |
Source code in desdeo/emo/options/mutation.py
Repair Functions
JSON Schema for repair operator options.
ClipRepairOptions
Bases: BaseModel
Options for Clip Repair.
Source code in desdeo/emo/options/repair.py
lower_bounds
class-attribute
instance-attribute
Lower bounds for the decision variables. If none, the lower bounds from the problem will be used.
name
class-attribute
instance-attribute
Clip the solutions to be within the variable bounds.
NoRepairOptions
Bases: BaseModel
Options for No Repair.
Source code in desdeo/emo/options/repair.py
repair_constructor
repair_constructor(
options: RepairOptions, problem: Problem
) -> Callable[[pl.DataFrame], pl.DataFrame]
Get the repair operator based on the provided options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
options
|
RepairOptions
|
The repair options. |
required |
problem
|
Problem
|
The optimization problem to solve. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
callable |
Callable[[DataFrame], DataFrame]
|
The repair operator function. |
Source code in desdeo/emo/options/repair.py
Scalar Selection Operators
JSON Schema for scalar selector operator options.
RouletteWheelSelectionOptions
Bases: TournamentSelectionOptions
Options for roulette wheel selection operator.
Source code in desdeo/emo/options/scalar_selection.py
TournamentSelectionOptions
Bases: BaseModel
Options for tournament selection operator.
Source code in desdeo/emo/options/scalar_selection.py
name
class-attribute
instance-attribute
name: Literal["TournamentSelection"] = Field(
default="TournamentSelection",
frozen=True,
description="The name of the scalar selection operator.",
)
The name of the scalar selection operator.
scalar_selector_constructor
scalar_selector_constructor(
options: ScalarSelectionOptions,
seed: int,
publisher: Publisher,
verbosity: int,
) -> BaseScalarSelector
Construct a scalar selector operator based on the provided options.
Source code in desdeo/emo/options/scalar_selection.py
Selection Operators
JSON Schema for selection operator options.
IBEASelectorOptions
Bases: BaseModel
Options for IBEA Selection.
Source code in desdeo/emo/options/selection.py
binary_indicator
class-attribute
instance-attribute
binary_indicator: Literal["eps", "hv"] = Field(
default="eps",
description="The binary indicator for IBEA.",
)
The binary indicator for IBEA.
kappa
class-attribute
instance-attribute
The kappa parameter for IBEA.
NSGA2SelectorOptions
Bases: BaseModel
Options for NSGA-II Selection.
Source code in desdeo/emo/options/selection.py
NSGA3SelectorOptions
Bases: BaseModel
Options for NSGA-III Selection.
Source code in desdeo/emo/options/selection.py
invert_reference_vectors
class-attribute
instance-attribute
invert_reference_vectors: bool = Field(
default=False,
description="Whether to invert the reference vectors (inverted triangle).",
)
Whether to invert the reference vectors (inverted triangle).
RVEASelectorOptions
Bases: BaseModel
Options for RVEA Selection.
Source code in desdeo/emo/options/selection.py
alpha
class-attribute
instance-attribute
alpha: float = Field(
default=2.0,
gt=0.0,
description="The alpha parameter in the angle penalized distance.",
)
The alpha parameter in the angle penalized distance.
name
class-attribute
instance-attribute
name: Literal["RVEASelector"] = Field(
default="RVEASelector",
frozen=True,
description="The name of the selection operator.",
)
The name of the selection operator.
parameter_adaptation_strategy
class-attribute
instance-attribute
parameter_adaptation_strategy: ParameterAdaptationStrategy = Field(
default=GENERATION_BASED,
description="The parameter adaptation strategy to use.",
)
Whether the angle penalized distance is adapted per generation or per function evaluation.
selection_constructor
selection_constructor(
problem: Problem,
options: SelectorOptions,
publisher: Publisher,
verbosity: int,
seed: int,
) -> BaseSelector
Construct a selection operator from given options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
problem
|
Problem
|
The optimization problem. |
required |
options
|
SelectorOptions
|
The options for the selection operator. |
required |
publisher
|
Publisher
|
The publisher to use for the operator. |
required |
verbosity
|
int
|
The verbosity level. |
required |
seed
|
int
|
The random seed. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
BaseSelector |
BaseSelector
|
The constructed selection operator. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If an unknown selection operator name is provided. |
Source code in desdeo/emo/options/selection.py
Termination Criteria
JSON Schema for termination operator options.
CompositeTerminatorOptions
Bases: BaseModel
Options for composite terminator operator.
Source code in desdeo/emo/options/termination.py
mode
class-attribute
instance-attribute
mode: Literal["all", "any"] = Field(
default="any",
description="Whether to use logical AND or OR.",
)
Whether to use logical AND or OR.
name
class-attribute
instance-attribute
name: Literal["CompositeTerminator"] = Field(
default="CompositeTerminator",
frozen=True,
description="The name of the termination operator.",
)
The name of the termination operator.
terminators
class-attribute
instance-attribute
terminators: list[
MaxEvaluationsTerminatorOptions
| MaxGenerationsTerminatorOptions
| MaxTimeTerminatorOptions
| ExternalCheckTerminatorOptions
] = Field(
default_factory=lambda: [
MaxGenerationsTerminatorOptions()
],
description="List of terminators.",
)
List of terminators.
check_unique_terminator_types
Ensure that all terminator types in the composite are unique.
Source code in desdeo/emo/options/termination.py
ExternalCheckTerminatorOptions
Bases: BaseModel
Options for external check terminator operator. Note that the check function must be provided separately.
Source code in desdeo/emo/options/termination.py
MaxEvaluationsTerminatorOptions
Bases: BaseModel
Options for max evaluations terminator operator.
Source code in desdeo/emo/options/termination.py
MaxGenerationsTerminatorOptions
Bases: BaseModel
Options for max generations terminator operator.
Source code in desdeo/emo/options/termination.py
MaxTimeTerminatorOptions
Bases: BaseModel
Options for max time terminator operator.
Source code in desdeo/emo/options/termination.py
terminator_constructor
terminator_constructor(
options: TerminatorOptions,
publisher: Publisher,
external_check: Callable | None = None,
) -> BaseTerminator
Construct a termination operator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
options
|
TerminatorOptions
|
Options for the termination operator. |
required |
publisher
|
Publisher
|
Publisher instance for the termination operator. |
required |
external_check
|
Callable | None
|
External check function for the termination operator. Defaults to None. Only required if using ExternalCheckTerminator. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the options are invalid. |
ValueError
|
If the external check function is required but not provided. |
Returns:
| Name | Type | Description |
|---|---|---|
BaseTerminator |
BaseTerminator
|
Instance of the termination operator. |