feat(algorithms): add ParticleSwarm (canonical PSO) for Vec<f64>
Eberhart & Kennedy 1995 PSO with the standard inertia-weight update: v[i,t+1] = w·v[i,t] + c1·r1·(pbest[i] - x[i,t]) + c2·r2·(gbest - x[i,t]) x[i,t+1] = clamp(x[i,t] + v[i,t+1], bounds) Single-objective only, `Vec<f64>` decisions only (PSO's velocity vector needs a Euclidean structure that doesn't generalize cleanly to bool/perm). Velocities are clamped to ±(hi - lo) per dim to keep particles from exploding off into space. Config exposes the four standard knobs — swarm size, generations, inertia w, cognitive c1, social c2 — plus a seed. Tests cover convergence on Sphere1D, deterministic reruns, and panic on multi-objective.
This commit is contained in:
@@ -8,6 +8,7 @@ pub mod nsga2;
|
||||
pub mod nsga3;
|
||||
pub mod paes;
|
||||
pub(crate) mod parallel_eval;
|
||||
pub mod particle_swarm;
|
||||
pub mod random_search;
|
||||
pub mod simulated_annealing;
|
||||
pub mod spea2;
|
||||
@@ -19,6 +20,7 @@ pub use moead::*;
|
||||
pub use nsga2::*;
|
||||
pub use nsga3::*;
|
||||
pub use paes::*;
|
||||
pub use particle_swarm::*;
|
||||
pub use random_search::*;
|
||||
pub use simulated_annealing::*;
|
||||
pub use spea2::*;
|
||||
|
||||
Reference in New Issue
Block a user