RVEA configuration¶
Configure rvea through vamos.algorithms.RVEAConfig. 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 RVEAConfig
Configuration overview · Algorithm contracts · Optimization
Development after 1.4.0: reference_vectors gives RVEA the reference
vectors of a file, a directory or a two-layer lattice, with the keys of MOEA/D's
weight_vectors and NSGA-III's reference_directions (see
reference vectors), so that
the three algorithms can start from the same vectors, as jMetal and Evolver
configure them:
from vamos import optimize
from vamos.algorithms import RVEAConfig
config = (
RVEAConfig.builder()
.pop_size(100)
.reference_vectors(path="weights/W3D_100.dat") # a copy of jMetal's file, which VAMOS also ships
.alpha(2.0)
.adapt_freq(0.1)
.crossover("sbx", prob=0.9, eta=30.0)
.mutation("pm", prob="1/n", eta=20.0)
.build()
)
result = optimize("dtlz2", algorithm="rvea", algorithm_config=config, max_evaluations=1000, seed=1)
RVEA keeps one individual per vector, so the file must hold pop_size
vectors; a directory is searched for W{n_obj}D_{pop_size}.dat, and a missing
or mismatching file raises before any evaluation. n_partitions is not used
with reference_vectors; the builder does not need it and records the
divisions (12 for a file). reference_vectors(divisions=12) runs the same
lattice as n_partitions(12). to_dict() leaves the field out while it is
None, so a configuration without it keeps the resolved specification, and the
task id, of VAMOS 1.4.0. The resolved spec of a run with a file records it in
algorithm.resolution.reference_vectors, for example
{"source": "file", "file": "W3D_100.dat", "vectors": 100}. Study planning
rejects a path, as it does for NSGA-III, and checks that pop_size equals the
vectors of divisions and inner_divisions.
Development after 1.4.0: variant chooses the reading of the survival:
"pymoo" (default, the results of VAMOS 1.4.0) or "platemo", the authors'
PlatEMO code and jMetal, with M equal to the number of objectives in the angle
penalty for two objectives too, translation by each generation's minimum and
adaptation to the population's range (see the class below and
where the variants depart).
to_dict() leaves out the default, so configurations without it keep their
resolved specification and task id.
RVEAConfig
dataclass
¶
Bases: _SerializableConfig
Configuration of RVEA.
RVEA keeps one individual per reference vector, so pop_size must equal their number. By
default the vectors are the complete Das-Dennis lattice of n_partitions.
Development after 1.4.0: reference_vectors takes the vectors from elsewhere, with the
keys of MOEA/D's weight_vectors and NSGA-III's reference_directions:
path: a file with one vector per line, its components separated by whitespace or commas, or a directory with jMetal'sW{n_obj}D_{pop_size}.datfiles, such as the jMetal files VAMOS ships (W3D_100.datruns 100 individuals with three objectives). The file must exist and holdpop_sizevectors;divisions: the lattice of that many divisions, asn_partitions;divisionsandinner_divisions: Deb and Jain's two-layer lattice, the boundary layer ofdivisionsand an inside layer ofinner_divisions(see :func:~vamos.engine.reference_directions.two_layer_lattice).
With reference_vectors, n_partitions is not used. to_dict() leaves the field out
while it is None, so a configuration without it keeps the resolved specification, and the
task id, of VAMOS 1.4.0.
Development after 1.4.0: variant chooses between the two readings of the survival.
"pymoo", the default and VAMOS's RVEA so far, follows pymoo: with two objectives the angle
penalty uses M = 1, the objectives are translated by the ideal point accumulated across
generations, and the vectors adapt to the nadir point minus that ideal point. "platemo"
follows the authors' code in PlatEMO (RVEA/EnvironmentalSelection.m and
ReferenceVectorAdaptation.m) and jMetal's RVEAEnvironmentalSelection: M is the number of
objectives, two included, so the penalty is M (t / t_max)^alpha theta / gamma for every
number of objectives, the objectives are translated by the minimum of the candidates of each
generation, and the vectors adapt to the range (maximum minus minimum) of the population. Both
keep VAMOS's progress t / t_max in generations, its feasibility-first constrained survival
and its parent selection. to_dict() leaves out the default.
default(pop_size=None, n_var=None, n_obj=3, encoding=None)
classmethod
¶
Create a default RVEA configuration.
RVEA needs one individual per reference vector. With pop_size,
n_partitions is the Das-Dennis lattice of exactly that size, and a size
that matches no lattice raises :class:~vamos.exceptions.ConfigurationError
naming the nearest valid ones. Without it, n_partitions is 99 for two
objectives, 12 for three and 6 for four or more. Discrete and mixed
encoding values take their crossover and mutation from the shared
encoding table.
Builder methods¶
Use RVEAConfig.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, _RepairBuilder, _InitializerBuilder, _MutationProbFactorBuilder, _ConstraintHandlingBuilder, _ConstraintModeBuilder, _TrackGenealogyBuilder, _ResultArchiveBuilder
Declarative configuration holder for RVEA settings.
Examples: cfg = RVEAConfig.default() cfg = RVEAConfig.builder().pop_size(100).n_partitions(12).build()
reference_vectors(*, path=None, divisions=None, inner_divisions=None)
¶
Development after 1.4.0: the reference vectors: a file or directory, or a lattice.
path names a file with one vector per line, its components separated by whitespace or
commas, or a directory with jMetal's W{n_obj}D_{pop_size}.dat files; the file must exist
and hold pop_size vectors. Without it, divisions gives the lattice, and with
inner_divisions Deb and Jain's two-layer lattice. n_partitions is then not needed:
without it, the configuration records divisions, or 12 for a file.
variant(value)
¶
Development after 1.4.0: the reading of RVEA's survival, "pymoo" (default) or "platemo".
"platemo" follows the authors' PlatEMO code and jMetal: M is the number of objectives in the
angle penalty also with two objectives, the objectives are translated by the minimum of each
generation's candidates, and the vectors adapt to the population's range. See :class:RVEAConfig.