desdeo-emo
Methods
desdeo.emo.methods.EAs
Implements common evolutionary algorithms for multi-objective optimization.
nsga3
nsga3(*, problem: Problem, seed: int = 0, n_generations: int = 100, reference_vector_options: ReferenceVectorOptions = None, forced_verbosity: int | None = None) -> tuple[Callable[[], EMOResult], Publisher]
Implements the NSGA-III algorithm as well as its interactive version.
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.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
problem
|
Problem
|
The problem to be solved. |
required |
seed
|
int
|
The seed for the random number generator. Defaults to 0. |
0
|
n_generations
|
int
|
The number of generations to run the algorithm. Defaults to 100. |
100
|
reference_vector_options
|
ReferenceVectorOptions
|
The options for the reference vectors. Defaults to None. See the ReferenceVectorOptions class for the defaults. This option can be used to run an interactive version of the algorithm, using preferences provided by the user. |
None
|
forced_verbosity
|
int
|
If not None, the verbosity of the algorithm is forced to this value. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
tuple[Callable[[], EMOResult], Publisher]
|
tuple[Callable[[], EMOResult], Publisher]: A tuple containing the function to run the algorithm and the publisher object. The publisher object can be used to subscribe to the topics of the algorithm components, as well as to inject additional functionality such as archiving the results. |
Source code in desdeo/emo/methods/EAs.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
rvea
rvea(*, problem: Problem, seed: int = 0, n_generations=100, reference_vector_options: ReferenceVectorOptions = None, forced_verbosity: int | None = None) -> tuple[Callable[[], EMOResult], Publisher]
Implements the Reference Vector Guided Evolutionary Algorithm (RVEA), as well as its interactive version.
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.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
problem
|
Problem
|
The problem to be solved. |
required |
seed
|
int
|
The seed for the random number generator. Defaults to 0. |
0
|
n_generations
|
int
|
The number of generations to run the algorithm. Defaults to 100. |
100
|
reference_vector_options
|
ReferenceVectorOptions
|
The options for the reference vectors. Defaults to None. See the ReferenceVectorOptions class for the defaults. This option can be used to run an interactive version of the algorithm, using preferences provided by the user. |
None
|
forced_verbosity
|
int
|
If not None, the verbosity of the algorithm is forced to this value. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
tuple[Callable[[], EMOResult], Publisher]
|
tuple[Callable[[], EMOResult], Publisher]: A tuple containing the function to run the algorithm and the publisher object. The publisher object can be used to subscribe to the topics of the algorithm components, as well as to inject additional functionality such as archiving the results. |
Source code in desdeo/emo/methods/EAs.py
Templates
desdeo.emo.methods.bases
This module contains the basic functional implementations for the EMO methods.
This can be used as a template for the implementation of the EMO methods.
EMOResult
Bases: BaseModel
Source code in desdeo/emo/methods/bases.py
template1
template1(evaluator: EMOEvaluator, crossover: BaseCrossover, mutation: BaseMutation, generator: BaseGenerator, selection: BaseSelector, terminator: BaseTerminator) -> EMOResult
Implements a template that many EMO methods, such as RVEA and NSGA-III, follow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
evaluator
|
EMOEvaluator
|
A class that evaluates the solutions and provides the objective vectors, constraint vectors, and targets. |
required |
crossover
|
BaseCrossover
|
The crossover operator. |
required |
mutation
|
BaseMutation
|
The mutation operator. |
required |
generator
|
BaseGenerator
|
A class that generates the initial population. |
required |
selection
|
BaseSelector
|
The selection operator. |
required |
terminator
|
BaseTerminator
|
The termination operator. |
required |
Returns:
Name | Type | Description |
---|---|---|
EMOResult |
EMOResult
|
The final population and their objective vectors, constraint vectors, and targets |
Source code in desdeo/emo/methods/bases.py
Generators
desdeo.emo.operators.generator
Class for generating initial population for the evolutionary optimization algorithms.
BaseGenerator
Bases: Subscriber
Base class for generating initial population for the evolutionary optimization algorithms.
This class should be inherited by the classes that implement the initial population generation for the evolutionary optimization algorithms.
Source code in desdeo/emo/operators/generator.py
interested_topics
property
Return the message topics that the generator is interested in.
provided_topics
property
Return the topics provided by the generator.
Returns:
Type | Description |
---|---|
dict[int, Sequence[GeneratorMessageTopics]]
|
dict[int, Sequence[GeneratorMessageTopics]]: The topics provided by the generator. |
__init__
Initialize the BaseGenerator class.
Source code in desdeo/emo/operators/generator.py
do
abstractmethod
Generate the initial population.
This method should be implemented by the inherited classes.
Returns:
Type | Description |
---|---|
tuple[DataFrame, DataFrame]
|
tuple[pl.DataFrame, pl.DataFrame]: The initial population as the first element, the corresponding objectives, the constraint violations, and the targets as the second element. |
Source code in desdeo/emo/operators/generator.py
state
Return the state of the generator.
This method should be implemented by the inherited classes.
Returns:
Name | Type | Description |
---|---|---|
dict |
Sequence[Message]
|
The state of the generator. |
Source code in desdeo/emo/operators/generator.py
LHSGenerator
Bases: RandomGenerator
Class for generating Latin Hypercube Sampling (LHS) initial population for the MOEAs.
This class generates the initial population by using the Latin Hypercube Sampling (LHS) method. If the seed is not provided, the seed is set to 0.
Source code in desdeo/emo/operators/generator.py
__init__
Initialize the LHSGenerator class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
problem
|
Problem
|
The problem to solve. |
required |
evaluator
|
BaseEvaluator
|
The evaluator to evaluate the population. |
required |
n_points
|
int
|
The number of points to generate for the initial population. |
required |
seed
|
int
|
The seed for the random number generator. |
required |
kwargs
|
Additional keyword arguments. Check the Subscriber class for more information. At the very least, the publisher argument should be provided. |
{}
|
Source code in desdeo/emo/operators/generator.py
do
Generate the initial population.
This method should be implemented by the inherited classes.
Returns:
Type | Description |
---|---|
tuple[DataFrame, DataFrame]
|
tuple[pl.DataFrame, pl.DataFrame]: The initial population as the first element, the corresponding objectives, the constraint violations, and the targets as the second element. |
Source code in desdeo/emo/operators/generator.py
RandomBinaryGenerator
Bases: BaseGenerator
Class for generating random initial population for problems with binary variables.
This class generates an initial population by randomly setting variable values to be either 0 or 1.
Source code in desdeo/emo/operators/generator.py
__init__
Initialize the RandomBinaryGenerator class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
problem
|
Problem
|
The problem to solve. |
required |
evaluator
|
BaseEvaluator
|
The evaluator to evaluate the population. |
required |
n_points
|
int
|
The number of points to generate for the initial population. |
required |
seed
|
int
|
The seed for the random number generator. |
required |
kwargs
|
Additional keyword arguments. Check the Subscriber class for more information. At the very least, the publisher argument should be provided. |
{}
|
Source code in desdeo/emo/operators/generator.py
do
Generate the initial population.
Returns:
Type | Description |
---|---|
tuple[DataFrame, DataFrame]
|
tuple[pl.DataFrame, pl.DataFrame]: The initial population as the first element, the corresponding objectives, the constraint violations, and the targets as the second element. |
Source code in desdeo/emo/operators/generator.py
RandomGenerator
Bases: BaseGenerator
Class for generating random initial population for the evolutionary optimization algorithms.
This class generates the initial population by randomly sampling the points from the variable bounds. The distribution of the points is uniform. If the seed is not provided, the seed is set to 0.
Source code in desdeo/emo/operators/generator.py
__init__
Initialize the RandomGenerator class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
problem
|
Problem
|
The problem to solve. |
required |
evaluator
|
BaseEvaluator
|
The evaluator to evaluate the population. |
required |
n_points
|
int
|
The number of points to generate for the initial population. |
required |
seed
|
int
|
The seed for the random number generator. |
required |
kwargs
|
Additional keyword arguments. Check the Subscriber class for more information. At the very least, the publisher argument should be provided. |
{}
|
Source code in desdeo/emo/operators/generator.py
do
Generate the initial population.
This method should be implemented by the inherited classes.
Returns:
Type | Description |
---|---|
tuple[DataFrame, DataFrame]
|
tuple[pl.DataFrame, pl.DataFrame]: The initial population as the first element, the corresponding objectives, the constraint violations, and the targets as the second element. |
Source code in desdeo/emo/operators/generator.py
RandomIntegerGenerator
Bases: BaseGenerator
Class for generating random initial population for problems with integer variables.
This class generates an initial population by randomly setting variable values to be integers between the bounds of the variables.
Source code in desdeo/emo/operators/generator.py
__init__
Initialize the RandomIntegerGenerator class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
problem
|
Problem
|
The problem to solve. |
required |
evaluator
|
BaseEvaluator
|
The evaluator to evaluate the population. |
required |
n_points
|
int
|
The number of points to generate for the initial population. |
required |
seed
|
int
|
The seed for the random number generator. |
required |
kwargs
|
Additional keyword arguments. Check the Subscriber class for more information. At the very least, the publisher argument should be provided. |
{}
|
Source code in desdeo/emo/operators/generator.py
do
Generate the initial population.
Returns:
Type | Description |
---|---|
tuple[DataFrame, DataFrame]
|
tuple[pl.DataFrame, pl.DataFrame]: The initial population as the first element, the corresponding objectives, the constraint violations, and the targets as the second element. |
Source code in desdeo/emo/operators/generator.py
Evaluator
desdeo.emo.operators.evaluator
Classes for evaluating the objectives and constraints of the individuals in the population.
EMOEvaluator
Bases: Subscriber
Base class for evaluating the objectives and constraints of the individuals in the population.
This class should be inherited by the classes that implement the evaluation of the objectives and constraints of the individuals in the population.
Source code in desdeo/emo/operators/evaluator.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
provided_topics
property
The topics provided by the Evaluator.
__init__
Initialize the EMOEvaluator class.
Source code in desdeo/emo/operators/evaluator.py
evaluate
Evaluate and return the objectives.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
population
|
Dataframe
|
The set of decision variables to evaluate. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pl.Dataframe: A dataframe of objective vectors, target vectors, and constraint vectors. |
Source code in desdeo/emo/operators/evaluator.py
state
The state of the evaluator sent to the Publisher.
Source code in desdeo/emo/operators/evaluator.py
Crossover operators
desdeo.emo.operators.crossover
Evolutionary operators for recombination.
Various evolutionary operators for recombination in multiobjective optimization are defined here.
BaseCrossover
Bases: Subscriber
A base class for crossover operators.
Source code in desdeo/emo/operators/crossover.py
__init__
Initialize a crossover operator.
Source code in desdeo/emo/operators/crossover.py
do
abstractmethod
Perform the crossover operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
population
|
DataFrame
|
the population to perform the crossover with. The DataFrame contains the decision vectors, the target vectors, and the constraint vectors. |
required |
to_mate
|
list[int] | None
|
the indices of the population members that should
participate in the crossover. If |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
pl.DataFrame: the offspring resulting from the crossover. |
Source code in desdeo/emo/operators/crossover.py
SimulatedBinaryCrossover
Bases: BaseCrossover
A class for creating a simulated binary crossover operator.
Reference
Kalyanmoy Deb and Ram Bhushan Agrawal. 1995. Simulated binary crossover for continuous search space. Complex Systems 9, 2 (1995), 115-148.
Source code in desdeo/emo/operators/crossover.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
|
interested_topics
property
The message topics the crossover operator is interested in.
provided_topics
property
The message topics provided by the crossover operator.
__init__
__init__(*, problem: Problem, seed: int, xover_probability: float = 1.0, xover_distribution: float = 30, **kwargs)
Initialize a simulated binary crossover operator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
problem
|
Problem
|
the problem object. |
required |
seed
|
int
|
the seed for the random number generator. |
required |
xover_probability
|
float
|
the crossover probability parameter. Ranges between 0 and 1.0. Defaults to 1.0. |
1.0
|
xover_distribution
|
float
|
the crossover distribution parameter. Must be positive. Defaults to 30. |
30
|
kwargs
|
Additional keyword arguments. These are passed to the Subscriber class. At the very least, the publisher must be passed. See the Subscriber class for more information. |
{}
|
Source code in desdeo/emo/operators/crossover.py
do
Perform the simulated binary crossover operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
population
|
DataFrame
|
the population to perform the crossover with. The DataFrame contains the decision vectors, the target vectors, and the constraint vectors. |
required |
to_mate
|
list[int] | None
|
the indices of the population members that should
participate in the crossover. If |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
pl.DataFrame: the offspring resulting from the crossover. |
Source code in desdeo/emo/operators/crossover.py
state
Return the state of the crossover operator.
Source code in desdeo/emo/operators/crossover.py
SinglePointBinaryCrossover
Bases: BaseCrossover
A class that defines the single point binary crossover operation.
Source code in desdeo/emo/operators/crossover.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 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 |
|
interested_topics
property
The message topics the single point binary crossover operator is interested in.
provided_topics
property
The message topics provided by the single point binary crossover operator.
__init__
Initialize the single point binary crossover operator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
problem
|
Problem
|
the problem object. |
required |
seed
|
int
|
the seed used in the random number generator for choosing the crossover point. |
required |
kwargs
|
Additional keyword arguments. These are passed to the Subscriber class. At the very least, the publisher must be passed. See the Subscriber class for more information. |
{}
|
Source code in desdeo/emo/operators/crossover.py
do
Perform single point binary crossover.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
population
|
DataFrame
|
the population to perform the crossover with. |
required |
to_mate
|
list[int] | None
|
indices. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
pl.DataFrame: the offspring from the crossover. |
Source code in desdeo/emo/operators/crossover.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 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 |
|
state
Return the state of the single ponit binary crossover operator.
Source code in desdeo/emo/operators/crossover.py
UniformIntegerCrossover
Bases: BaseCrossover
A class that defines the uniform integer crossover operation.
Source code in desdeo/emo/operators/crossover.py
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 |
|
interested_topics
property
The message topics the single point binary crossover operator is interested in.
provided_topics
property
The message topics provided by the single point binary crossover operator.
__init__
Initialize the uniform integer crossover operator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
problem
|
Problem
|
the problem object. |
required |
seed
|
int
|
the seed used in the random number generator for choosing the crossover point. |
required |
kwargs
|
Additional keyword arguments. These are passed to the Subscriber class. At the very least, the publisher must be passed. See the Subscriber class for more information. |
{}
|
Source code in desdeo/emo/operators/crossover.py
do
Perform single point binary crossover.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
population
|
DataFrame
|
the population to perform the crossover with. |
required |
to_mate
|
list[int] | None
|
indices. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
pl.DataFrame: the offspring from the crossover. |
Source code in desdeo/emo/operators/crossover.py
state
Return the state of the single ponit binary crossover operator.
Source code in desdeo/emo/operators/crossover.py
Mutation operators
desdeo.emo.operators.mutation
Evolutionary operators for mutation.
Various evolutionary operators for mutation in multiobjective optimization are defined here.
BaseMutation
Bases: Subscriber
A base class for mutation operators.
Source code in desdeo/emo/operators/mutation.py
__init__
abstractmethod
Initialize a mu operator.
Source code in desdeo/emo/operators/mutation.py
do
abstractmethod
Perform the mutation operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
offsprings
|
DataFrame
|
the offspring population to mutate. |
required |
parents
|
DataFrame
|
the parent population from which the offspring was generated (via crossover). |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pl.DataFrame: the offspring resulting from the mutation. |
Source code in desdeo/emo/operators/mutation.py
BinaryFlipMutation
Bases: BaseMutation
Implements the bit flip mutation operator for binary variables.
The binary flip mutation will mutate each binary decision variable, by flipping it (0 to 1, 1 to 0) with a provided probability.
Source code in desdeo/emo/operators/mutation.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 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 |
|
interested_topics
property
The message topics that the mutation operator is interested in.
provided_topics
property
The message topics provided by the mutation operator.
__init__
Initialize a binary flip mutation operator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
problem
|
Problem
|
The problem object. |
required |
seed
|
int
|
The seed for the random number generator. |
required |
mutation_probability
|
float | None
|
The probability of mutation. If None, the probability will be set to be 1/n, where n is the number of decision variables in the problem. Defaults to None. |
None
|
kwargs
|
Additional keyword arguments. These are passed to the Subscriber class. At the very least, the publisher must be passed. See the Subscriber class for more information. |
{}
|
Source code in desdeo/emo/operators/mutation.py
do
Perform the binary flip mutation operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
offsprings
|
DataFrame
|
the offspring population to mutate. |
required |
parents
|
DataFrame
|
the parent population from which the offspring was generated (via crossover). Not used in the mutation operator. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pl.DataFrame: the offspring resulting from the mutation. |
Source code in desdeo/emo/operators/mutation.py
state
Return the state of the mutation operator.
Source code in desdeo/emo/operators/mutation.py
BoundedPolynomialMutation
Bases: BaseMutation
Implements the bounded polynomial mutation operator.
Reference
Deb, K., & Goyal, M. (1996). A combined genetic adaptive search (GeneAS) for engineering design. Computer Science and informatics, 26(4), 30-45, 1996.
Source code in desdeo/emo/operators/mutation.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
|
interested_topics
property
The message topics that the mutation operator is interested in.
provided_topics
property
The message topics provided by the mutation operator.
__init__
__init__(*, problem: Problem, seed: int, mutation_probability: float | None = None, distribution_index: float = 20, **kwargs)
Initialize a bounded polynomial mutation operator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
problem
|
Problem
|
The problem object. |
required |
seed
|
int
|
The seed for the random number generator. |
required |
mutation_probability
|
float | None
|
The probability of mutation. Defaults to None. |
None
|
distribution_index
|
float
|
The distributaion index for polynomial mutation. Defaults to 20. |
20
|
kwargs
|
Additional keyword arguments. These are passed to the Subscriber class. At the very least, the publisher must be passed. See the Subscriber class for more information. |
{}
|
Source code in desdeo/emo/operators/mutation.py
do
Perform the mutation operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
offsprings
|
DataFrame
|
the offspring population to mutate. |
required |
parents
|
DataFrame
|
the parent population from which the offspring was generated (via crossover). |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pl.DataFrame: the offspring resulting from the mutation. |
Source code in desdeo/emo/operators/mutation.py
state
Return the state of the mutation operator.
Source code in desdeo/emo/operators/mutation.py
IntegerRandomMutation
Bases: BaseMutation
Implements a random mutation operator for integer variables.
The mutation will mutate each binary integer variable, by changing its value to a random value bounded by the variable's bounds with a provided probability.
Source code in desdeo/emo/operators/mutation.py
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 |
|
interested_topics
property
The message topics that the mutation operator is interested in.
provided_topics
property
The message topics provided by the mutation operator.
__init__
Initialize a random integer mutation operator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
problem
|
Problem
|
The problem object. |
required |
seed
|
int
|
The seed for the random number generator. |
required |
mutation_probability
|
float | None
|
The probability of mutation. If None, the probability will be set to be 1/n, where n is the number of decision variables in the problem. Defaults to None. |
None
|
kwargs
|
Additional keyword arguments. These are passed to the Subscriber class. At the very least, the publisher must be passed. See the Subscriber class for more information. |
{}
|
Source code in desdeo/emo/operators/mutation.py
do
Perform the random integer mutation operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
offsprings
|
DataFrame
|
the offspring population to mutate. |
required |
parents
|
DataFrame
|
the parent population from which the offspring was generated (via crossover). Not used in the mutation operator. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pl.DataFrame: the offspring resulting from the mutation. |
Source code in desdeo/emo/operators/mutation.py
state
Return the state of the mutation operator.
Source code in desdeo/emo/operators/mutation.py
Selection operators
desdeo.emo.operators.selection
The base class for selection operators.
This whole file should be rewritten. Everything is a mess. Moreover, the selectors do not yet take seeds as input for reproducibility. TODO:@light-weaver
BaseDecompositionSelector
Bases: BaseSelector
Base class for decomposition based selection operators.
Source code in desdeo/emo/operators/selection.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 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 |
|
_create_simplex
Create the reference vectors using simplex lattice design.
Source code in desdeo/emo/operators/selection.py
_normalize_rvs
Normalize the reference vectors to a unit hypersphere.
Source code in desdeo/emo/operators/selection.py
add_edge_vectors
Add edge vectors to the list of reference vectors.
Used to cover the entire orthant when preference information is provided.
Source code in desdeo/emo/operators/selection.py
interactive_adapt_1
Adapt reference vectors using the information about prefererred solution(s) selected by the Decision maker.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
z
|
ndarray
|
Preferred solution(s). |
required |
translation_param
|
float
|
Parameter determining how close the reference vectors are to the central vector |
required |
Source code in desdeo/emo/operators/selection.py
interactive_adapt_2
Adapt reference vectors by using the information about non-preferred solution(s) selected by the Decision maker.
After the Decision maker has specified non-preferred solution(s), Euclidian distance between normalized solution vector(s) and each of the reference vectors are calculated. Those reference vectors that are closer than a predefined distance are either removed or re-positioned somewhere else.
Note
At the moment, only the removal of reference vectors is supported. Repositioning of the reference vectors is not supported.
Note
In case the Decision maker specifies multiple non-preferred solutions, the reference vector(s) for which the distance to any of the non-preferred solutions is less than predefined distance are removed.
Note
Future developer should implement a way for a user to say: "Remove some percentage of objecive space/reference vectors" rather than giving a predefined distance value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
z
|
ndarray
|
Non-preferred solution(s). |
required |
predefined_distance
|
float
|
The reference vectors that are closer than this distance are either removed or |
required |
Default
|
value
|
0.2 |
required |