ToP configuration¶
Configure top through vamos.algorithms.ToPConfig. This page is the parameter reference, not a tutorial about the algorithm; see ToP for the algorithm, its two phases and its budget rule.
New in VAMOS 1.2.0. The 1.0 compatibility baseline does not cover ToP and ToPConfig yet.
from vamos.algorithms import ToPConfig
Configuration overview · Algorithm contracts · Optimization
ToPConfig
dataclass
¶
Bases: _SerializableConfig
Configuration of ToP (Liu and Wang, 2019), with NSGA-II in its second phase.
pop_size is the size of the population, at least 1. The variation is ToP's differential
evolution for real variables: the crossover must be ("de", {"cr": ..., "f": ...}), whose
cr and f are the crossover rate and the scale factor of both phases, and the mutation
is applied to every trial vector. Phase 1 lasts while (delta >= delta_threshold or Pf <=
feasible_ratio_threshold) and the evaluations done are not more than
phase_one_evaluation_fraction of the budget.
default(pop_size=None, n_var=None)
classmethod
¶
Create the default ToP configuration: PlatEMO's, which jMetal's port also uses.
pop_size=None means 100. The differential evolution has CR = 1.0 and F = 0.5, and the
polynomial mutation probability 1/n and distribution index 20. The switch thresholds
are 0.2 for delta, 1/3 for Pf and 90% of the budget.
Builder methods¶
Use ToPConfig.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, _ConstraintModeBuilder, _ResultArchiveBuilder
Fluent builder for ToP configs.
Examples: cfg = ToPConfig.default(n_var=10) cfg = ToPConfig.builder().pop_size(100).crossover("de", cr=1.0, f=0.5).mutation("pm", prob="1/n", eta=20.0).build()
delta_threshold(value)
¶
Phase 1 goes on while delta is at least this value (or Pf is not above its threshold); 0.2 by default.
feasible_ratio_threshold(value)
¶
Phase 1 goes on while Pf is not above this value (or delta is at least its threshold); 1/3 by default.
phase_one_evaluation_fraction(value)
¶
Phase 1 ends when the evaluations done exceed this fraction of the budget; 0.9 by default.