Particle Swarm Optimizer Constructor
Definition
Namespace: Numerics.NET.Optimization
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.1.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.1.0
Overload List
Particle | Constructs a new ParticleSwarmOptimizer class. |
Particle | Constructs a new Particle Swarm optimizer with specified parameters. |
ParticleSwarmOptimizer
Constructs a new ParticleSwarmOptimizer class.
public ParticleSwarmOptimizer()
ParticleSwarmOptimizer(Func<Vector<Double>, Double>, Vector<Double>, Vector<Double>, Random, Int32, Double, Double, Double, Double, PopulationInitializationMethod, Double, Int32, ParticleSwarmTopology, Int32)
Constructs a new Particle Swarm optimizer with specified parameters.
public ParticleSwarmOptimizer(
Func<Vector<double>, double> objectiveFunction,
Vector<double> lowerBounds,
Vector<double> upperBounds,
Random? random = null,
int populationMultiplier = 10,
double inertiaWeight = 0.729,
double cognitiveCoefficient = 1.49445,
double socialCoefficient = 1.49445,
double maxVelocity = 4,
PopulationInitializationMethod initializationMethod = PopulationInitializationMethod.Random,
double populationDiversityTolerance = 0.0001,
int stagnationLimit = 20,
ParticleSwarmTopology topology = default,
int maxIterations = 8192
)
Parameters
- objectiveFunction Func<Vector<Double>, Double>
- The objective function to optimize.
- lowerBounds Vector<Double>
- The lower bounds for each parameter.
- upperBounds Vector<Double>
- The upper bounds for each parameter.
- random Random (Optional)
- Optional. A random number generator to use. The default is DefaultRandomNumberGenerator.
- populationMultiplier Int32 (Optional)
- Optional. A multiplier for the population size. The total population is the number of free parameters times this value. The default is 10.
- inertiaWeight Double (Optional)
- Optional. The inertia weight (ω) used to control impact of previous velocities. The default is 0.729 (Clerc's constriction coefficient).
- cognitiveCoefficient Double (Optional)
- Optional. The cognitive coefficient (c1) controlling influence of personal best. The default is 1.49445.
- socialCoefficient Double (Optional)
- Optional. The social coefficient (c2) controlling influence of global best. The default is 1.49445.
- maxVelocity Double (Optional)
- Optional. Maximum velocity factor as proportion of search space. The default is 4.0.
- initializationMethod PopulationInitializationMethod (Optional)
- Optional. The method used to initialize population. The default is Random.
- populationDiversityTolerance Double (Optional)
- Optional. Tolerance for population diversity test. The default is 1e-4.
- stagnationLimit Int32 (Optional)
- Optional. Number of iterations without improvement before declaring stagnation. The default is 20.
- topology ParticleSwarmTopology (Optional)
- Optional. The topology of the particle swarm. The default is Global.
- maxIterations Int32 (Optional)
- Optional. Maximum number of iterations. The default is 8192.