Class DecreasingInertia
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
A decreasing inertia: each velocity times the optimizer's inertia times a factor falling linearly with the
iterations to the threshold at the last: QuantLib's DecreasingInertia.
[Experimental("NQL0001")]
public sealed class DecreasingInertia : ParticleSwarmOptimizationInertia
- Inheritance
-
DecreasingInertia
- Inherited Members
Remarks
The factor is threshold + (1 − threshold)(K − k)/K at the k-th call of K iterations, k counted from 1, so the last
iteration's is the threshold. QuantLib's never sets its swarm size, which it loops over (undefined), and never
advances its iteration, so its factor stays 1 and the inertia never decreases
(Divergences/ParticleSwarmInertiaTests.cs).
Constructors
DecreasingInertia(double)
Initializes a new instance of the DecreasingInertia class.
public DecreasingInertia(double threshold = 0.5)
Parameters
thresholddoubleThe last iteration's factor, in [0, 1); QuantLib's default 0.5.
Exceptions
- ArgumentException
thresholdis outside [0, 1), with QuantLib's text.
Methods
Clone()
A copy for a minimization, unbound, its generators at their seeds.
public override ParticleSwarmOptimizationInertia Clone()
Returns
- ParticleSwarmOptimizationInertia
The copy.
SetSize(int, int, double, EndCriteria)
Initializes the state for the problem (QuantLib's setSize).
public override void SetSize(int M, int N, double c0, EndCriteria endCriteria)
Parameters
MintThe swarm's size.
NintThe dimension.
c0doubleThe optimizer's inertia.
endCriteriaEndCriteriaThe minimization's end criteria.
SetValues()
Changes the swarm's velocities for the iteration (QuantLib's setValues).
public override void SetValues()