DifferentialEvolution

Undocumented in source.

Members

Functions

currentBestFit
RANGE currentBestFit()

Return the current best fitting parameters

initialize
void initialize()
Undocumented in source. Be warned that the author may not have intended to support it.
minimize
RANGE minimize()
Undocumented in source. Be warned that the author may not have intended to support it.
randomIndividual
RANGE randomIndividual()
Undocumented in source. Be warned that the author may not have intended to support it.
step
bool step()

Perform one minimization step (generation)

temperatureFunction
double temperatureFunction(RANGE parameters)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

randomIndividual
F randomIndividual [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
temperatureFunction
F temperatureFunction [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

tau1
double tau1;

Tweaking parameter, see Brest et al for details

tau2
double tau2;

Tweaking parameter, see Brest et al for details

Examples

// Function to minimize
auto fn = ( double[] xs ) {
    auto p = [ 1.0, 2.0, 10, 20, 30 ];
    return p[2] * (xs[0] - p[0]) * (xs[0] - p[0]) +
        p[3] * (xs[1] - p[1]) * (xs[1] - p[1]) + p[4];
};

// Function which will create random initial sets of parameters 
auto initFunction = ()
{
    return [ uniform( 0.0, 10.0 ), uniform( 0.0, 10.0 )];
};

auto de = new DifferentialEvolution!(double[])();
de.temperatureFunction = fn;
de.randomIndividual = initFunction;

auto min = de.minimize;

assert( equal!approxEqual( min, [ 1, 2 ] ) );

Meta