Package-level declarations
Types
Strategy interface for handling particles that move outside the input ranges. Given a continuous position, a boundary handler returns a position brought back within each input's [lowerBound, upperBound]. The handler returns a new array; it does not modify the supplied one. The result is still passed through ksl.simopt.problem.ProblemDefinition.toInputMap by the solver for granularity rounding before evaluation.
Clamps each coordinate to its input range: values below the lower bound become the lower bound, values above the upper bound become the upper bound. This is the default boundary handler.
If supplied, this function determines the cognitive and social acceleration coefficients (c1, c2) each iteration, overriding the scalar ParticleSwarmSolver.cognitiveCoefficient and ParticleSwarmSolver.socialCoefficient. The returned pair is (c1, c2).
A constant inertia-weight schedule: the inertia weight is the same at every iteration.
Abstract base class for inertia-weight schedules.
Defines the inertia-weight schedule used by particle swarm optimization. The inertia weight scales the contribution of a particle's previous velocity at each iteration, trading off exploration (large weight) for exploitation (small weight) as the search progresses. This is the PSO analogue of the simulated-annealing cooling schedule.
A linearly decreasing inertia-weight schedule. The inertia weight decreases linearly from initialInertia toward finalInertia over horizon iterations, then is held at finalInertia. This is the most common PSO inertia schedule.
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).
A global-best (gbest) Particle Swarm Optimization (PSO) solver for simulation optimization.
Reflects overshoot back into the input range: a value that exceeds a bound is mirrored back inside by the amount of the overshoot. A final clamp guards against a reflection that would overshoot the opposite bound (possible only when the overshoot exceeds the range width).
If supplied, this function determines the swarm size during the particle swarm process, overriding the scalar ParticleSwarmSolver.swarmSize.
Initializes each velocity component uniformly on [-vMax_d, +vMax_d]. Coordinates with a non-positive maximum speed are initialized to zero.
Strategy interface for initializing a particle's velocity at the start of a run. Randomness is drawn through the supplied solver's single random number stream (ParticleSwarmSolver.rnStream).
Initializes every particle's velocity to zero. This is the default and a common, stable choice: the swarm is initially driven only by the cognitive and social pulls.