Skip to content

SMPSO configuration

Configure smpso through vamos.algorithms.SMPSOConfig. 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 SMPSOConfig

Configuration overview · Algorithm contracts · Optimization

SMPSOConfig dataclass

Bases: _SerializableConfig

default(pop_size=None, n_var=None, encoding=None) classmethod

Create a default SMPSO configuration.

pop_size=None means 100. A mixed encoding takes its mutation from the shared encoding table; SMPSO supports real and mixed encodings.

Builder methods

Use SMPSOConfig.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, _MutationBuilder, _RepairBuilder, _InitializerBuilder, _ConstraintHandlingBuilder, _ConstraintModeBuilder, _TrackGenealogyBuilder, _ResultArchiveBuilder

Declarative configuration holder for SMPSO settings.

c1(value)

Lower bound of the personal-best coefficient (default 1.5).

At every step each particle draws its coefficient from U[value, value + 1], as jMetal does. When the two drawn coefficients add up to more than 4, the constriction coefficient scales the velocity.

c2(value)

Lower bound of the leader coefficient (default 1.5), drawn like c1 from U[value, value + 1].

external_archive(capacity=None, **kwargs)

Configure an external archive for result storage.

Note

This is separate from archive_size, which controls the internal SMPSO archive.

Parameters:

Name Type Description Default
capacity int | None

Maximum number of solutions. None means unbounded.

None
**kwargs Any

Forwarded to :class:ExternalArchiveConfig.

{}

inertia(value)

Fixed weight of a particle's previous velocity in the velocity update (default 0.1).