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.
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
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 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | |
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
xlemoo_options
Get default XLEMOO options as a Pydantic model.
XLEMOO alternates between Darwinian and Learning modes. Default cycle is 20 Darwinian iterations followed by 1 Learning iteration. The learning mode trains a SkopeRules classifier on the H/L split of past solutions and instantiates new candidates from the extracted rules.
References
Misitano, G. (2024). Exploring the explainable aspects and performance of a learnable evolutionary multiobjective optimization method. ACM Transactions on Evolutionary Learning and Optimization, 4(1), 1-39.
Returns:
| Name | Type | Description |
|---|---|---|
EMOOptions |
EMOOptions
|
The default XLEMOO options as a Pydantic model. |
Source code in desdeo/emo/options/algorithms.py
Templates
JSON Schema for template options.
XLEMOO_SCALARIZATIONS
module-attribute
XLEMOO_SCALARIZATIONS: dict[
str, Callable[..., tuple[Problem, str]]
] = {
"asf_nondiff": add_asf_nondiff,
"asf_diff": add_asf_diff,
"stom_nondiff": add_stom_sf_nondiff,
"stom_diff": add_stom_sf_diff,
"guess_nondiff": add_guess_sf_nondiff,
"guess_diff": add_guess_sf_diff,
}
Reference-point scalarizations selectable from XLEMOO. Each callable must accept
(problem, symbol, reference_point) and return (problem, target_symbol).
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.
learning_operator
class-attribute
instance-attribute
The XLEMOO learning-mode operator, if the template is XLEMOO. None otherwise.
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
TemplateXLEMOOOptions
Bases: BaseTemplateOptions
Options for the XLEMOO template.
The XLEMOO template alternates between Darwinian (standard EA) and Learning (rule extraction + instantiation) modes. See template_xlemoo for details.
Source code in desdeo/emo/options/templates.py
h_split
class-attribute
instance-attribute
h_split: float = Field(
default=0.2,
gt=0,
le=0.5,
description="Top fraction of unique individuals used as H-group.",
)
Top fraction of unique individuals used as H-group.
instantiation_factor
class-attribute
instance-attribute
instantiation_factor: float = Field(
default=10.0,
gt=0,
description="Multiplier on population_size deciding how many individuals to instantiate.",
)
Multiplier on population_size deciding how many individuals to instantiate.
l_split
class-attribute
instance-attribute
l_split: float = Field(
default=0.2,
gt=0,
le=0.5,
description="Bottom fraction of unique individuals used as L-group.",
)
Bottom fraction of unique individuals used as L-group.
n_darwin_per_cycle
class-attribute
instance-attribute
n_darwin_per_cycle: int = Field(
default=20,
gt=0,
description="Number of Darwinian iterations per cycle.",
)
Number of Darwinian iterations per cycle.
n_learning_per_cycle
class-attribute
instance-attribute
n_learning_per_cycle: int = Field(
default=1,
ge=0,
description="Number of Learning iterations per cycle.",
)
Number of Learning iterations per cycle. Set to 0 to disable Learning mode.
name
class-attribute
instance-attribute
name: Literal["TemplateXLEMOO"] = Field(
default="TemplateXLEMOO",
frozen=True,
description="The name of the template.",
)
The name of the template.
scalarization
class-attribute
instance-attribute
scalarization: Literal[
"asf_nondiff",
"asf_diff",
"stom_nondiff",
"stom_diff",
"guess_nondiff",
"guess_diff",
] = Field(
default="asf_nondiff",
description="Reference-point scalarization function added to the problem when a preference is supplied.",
)
Reference-point scalarization function added to the problem when a preference is supplied.
Must be one of the keys of XLEMOO_SCALARIZATIONS.
selection
class-attribute
instance-attribute
selection: ScalarSelectionOptions = Field(
description="The scalar selection operator (typically ElitistSelectionOptions)."
)
The scalar selection operator. XLEMOO is an elitist single-objective method, so the selection step is a scalar (top-N by a target column) rather than a multiobjective one.
_xlemoo_preference_handler
_xlemoo_preference_handler(
preference: PreferenceOptions | None,
problem: Problem,
selection: ScalarSelectionOptions,
scalarization: str,
) -> tuple[Problem, ScalarSelectionOptions]
Attach the chosen reference-point scalarization for XLEMOO and point the selector at it.
XLEMOO ranks solutions by a single scalarization target. If the user supplies a reference
point preference, the scalarization named by scalarization is added to the problem and
the selector's target_column is set to the resulting symbol. If no preference is given,
the selector's existing target_column is assumed to already match a scalarization
function on the problem.
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
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 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | |
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.
ElitistSelectionOptions
Bases: BaseModel
Options for elitist scalar selection (top winner_size by a target column).
Source code in desdeo/emo/options/scalar_selection.py
name
class-attribute
instance-attribute
name: Literal["ElitistSelection"] = Field(
default="ElitistSelection",
frozen=True,
description="The name of the scalar selection operator.",
)
The name of the scalar selection operator.
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. |