ParticleSwarm<T> constructor
ParticleSwarm<T> ({})
Implementation
ParticleSwarm({
required this.initParticles,
required this.toVector,
required this.fromVector,
required this.fitness,
required this.dim,
this.swarmSize = 30,
this.inertia = 0.7,
this.cognitive = 1.4,
this.social = 1.4,
int? seed,
}) : _rand = seed != null ? Random(seed) : Random() {
if (dim <= 0) throw ArgumentError('dim > 0');
if (swarmSize <= 0) throw ArgumentError('swarmSize > 0');
}