NSGA-III configuration¶
Configure nsgaiii through vamos.algorithms.NSGAIIIConfig. This page is the parameter reference, not a tutorial about the algorithm.
Stable public API. The 1.x compatibility policy defines the supported surface; import from the public facade shown below.
from vamos.algorithms import NSGAIIIConfig
Configuration overview · Algorithm contracts · Optimization
VAMOS 1.3.0: pop_size_auto and enforce_ref_dirs have no
effect: NSGA-III runs the largest reference-direction lattice that fits in
pop_size and keeps at least one individual per direction. Setting them with
the builder, or enforce_ref_dirs=False in the constructor or from_dict(),
emits a FutureWarning; both fields are planned for removal in 2.0 (see
stable configuration).
NSGAIIIConfig.default() does not warn. mutation_prob_factor now sets the
mutation probability to factor / n_var, as in NSGA-II.
Development after 1.4.0: the file of reference_directions(path=...) is
read as MOEA/D's weight files: one direction per line, the components separated
by whitespace or by commas (VAMOS 1.4.0 read commas only, so jMetal's
W3D_100.dat failed), every row non-negative and summing to one within the
rounding of jMetal's files (1e-5). A path that is not an existing file raises
ConfigurationError when the run starts; VAMOS 1.4.0 generated the lattice
instead and saved it at that path.
NSGAIIIConfig
dataclass
¶
Bases: _SerializableConfig
default(pop_size=None, n_var=None, n_obj=3, encoding=None)
classmethod
¶
Create a default NSGA-III configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pop_size
|
int | None
|
Population size. Defaults to the generated reference-direction count. |
None
|
n_var
|
int | None
|
Number of variables used for the default mutation probability. |
None
|
n_obj
|
int
|
Number of objectives used to choose the reference directions. With
|
3
|
encoding
|
EncodingLike | None
|
Problem encoding. Discrete and mixed encodings take their crossover and mutation from the shared encoding table. |
None
|
Builder methods¶
Use NSGAIIIConfig.builder() to obtain the fluent builder; do not import the private builder class directly. The methods below are generated from that returned object, so their signatures are not maintained as a second manual parameter table.
Bases: _ConfigBuilderState, _PopSizeBuilder, _CrossoverBuilder, _MutationBuilder, _SelectionBuilder, _RepairBuilder, _InitializerBuilder, _MutationProbFactorBuilder, _ResultArchiveBuilder, _ConstraintHandlingBuilder, _ConstraintModeBuilder, _TrackGenealogyBuilder
Declarative configuration holder for NSGA-III settings.
Examples: cfg = NSGAIIIConfig.default(n_obj=3) cfg = NSGAIIIConfig.builder().pop_size(92).crossover("sbx", prob=1.0).build()
enforce_ref_dirs(enabled=True)
¶
Kept for compatibility: it has no effect, warns, and goes in VAMOS 2.0.
pop_size_auto(enabled=True)
¶
Kept for compatibility: it has no effect, warns, and goes in VAMOS 2.0.
reference_directions(*, path=None, divisions=None)
¶
The reference directions: a file, or the complete Das-Dennis lattice of divisions.
path names a file with one direction per line, its components separated by whitespace or
by commas, such as jMetal's weight files (W3D_100.dat, which VAMOS ships). Without either,
NSGA-III runs the complete lattice with the most directions that fit in pop_size. The
population needs at least one individual per direction.
Development after 1.4.0: the file may use whitespace as well as commas, and a path
that is not a file raises :class:~vamos.exceptions.ConfigurationError when the run starts;
VAMOS 1.4.0 read commas only, and generated the lattice and saved it at a missing path.