ParticleSwarm<T> class

Constructors

ParticleSwarm({required List<T> initParticles(), required List<double> toVector(T), required T fromVector(List<double>), required double fitness(T), required int dim, int swarmSize = 30, double inertia = 0.7, double cognitive = 1.4, double social = 1.4, int? seed})

Properties

cognitive double
final
dim int
final
fitness double Function(T)
final
fromVector → T Function(List<double>)
final
hashCode int
The hash code for this object.
no setterinherited
inertia double
final
initParticles List<T> Function()
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
social double
final
swarmSize int
final
toVector List<double> Function(T)
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
optimize({int iterations = 200}) Map<String, dynamic>
Run optimization and return best particle and fitness.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited