Class DistributionRandomWalk<TDistribution>
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
A random walk whose step's radius is drawn from a distribution, its direction isotropic and its sphere an
ellipsoid over the problem's bounds, scaled by δ: QuantLib's DistributionRandomWalk.
[Experimental("NQL0001")]
public class DistributionRandomWalk<TDistribution> : FireflyAlgorithmRandomWalk where TDistribution : class, IRandomWalkDistribution
Type Parameters
TDistributionThe radius's distribution.
- Inheritance
-
DistributionRandomWalk<TDistribution>
- Derived
- Inherited Members
Remarks
Its isotropic walk draws the radius on a std::mt19937 and the direction on a Mersenne Twister, both on the
seed, which is required: QuantLib's default seeds from the clock.
Constructors
DistributionRandomWalk(TDistribution, double, long)
Initializes a new instance of the DistributionRandomWalk<TDistribution> class.
public DistributionRandomWalk(TDistribution dist, double delta, long seed)
Parameters
distTDistributionThe radius's distribution.
deltadoubleThe step's scale δ, QuantLib's default 0.9.
seedlongThe seed, in [1, 4294967295].
Exceptions
- ArgumentOutOfRangeException
seedis outside [1, 4294967295].
Properties
Delta
Gets or sets the step's scale δ, QuantLib's delta_, which a derived walk may change.
protected double Delta { get; set; }
Property Value
Distribution
Gets the distribution.
protected TDistribution Distribution { get; }
Property Value
- TDistribution
Seed
Gets the seed.
protected long Seed { get; }
Property Value
Methods
Clone()
A copy for a minimization, unbound, its generators at their seeds.
public override FireflyAlgorithmRandomWalk Clone()
Returns
- FireflyAlgorithmRandomWalk
The copy.
Init()
Prepares the walk once it is bound to a population, QuantLib's init; nothing by default.
protected override void Init()
Remarks
The isotropic walk's dimension and ellipsoid set from the problem's bounds.
WalkImpl(Vector)
Draws one firefly's walk.
protected override void WalkImpl(Vector xRW)
Parameters
xRWVectorThe walk, which it sets.
Remarks
The isotropic walk's step, times δ.