Particle

A mutable holder for the per-iteration state of a single particle in a particle swarm. A particle moves in continuous space: its position and velocity are off-grid coordinate vectors. The particle is evaluated at the granular point obtained by rounding position to the problem's granularity; that evaluated Solution is its currentSolution. The particle remembers its personal best Solution (bestSolution) and the continuous position at which it occurred (bestPosition).

Instances are created and managed only by ParticleSwarmSolver; the constructor is therefore module-internal.

Parameters

position

the continuous position vector (problem input order)

velocity

the continuous velocity vector (problem input order)

Properties

Link copied to clipboard

The continuous position associated with the personal best bestSolution.

Link copied to clipboard
lateinit var bestSolution: Solution

The best solution this particle has personally found so far (its personal best).

Link copied to clipboard

The solution obtained by evaluating the particle at its current (granular) position.

Link copied to clipboard
Link copied to clipboard