Description

Differential evolution for multidimensional minimization.

Package Information

Version0.1.7 (2015-Jun-11)
Repositoryhttps://github.com/BlackEdder/minimized
LicenseApache v2.0
CopyrightCopyright © 2015, Edwin van Leeuwen
AuthorsEdwin van Leeuwen
Registered byEdwin van Leeuwen
Dependenciesnone

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

Minimized

Library for (multi)dimensional minimization written in D. Currently limited to an implementation of adaptive differential evolution as explained in:

Brest, J., S. Greiner, B. Boskovic, M. Mernik, and V. Zumer. ‘Self-Adapting Control Parameters in Differential Evolution: A Comparative Study on Numerical Benchmark Problems’. IEEE Transactions on Evolutionary Computation 10, no. 6 (December 2006): 646–57. doi:10.1109/TEVC.2006.872133.

import minimized;

void main()
{
    // 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 ] ) );
}

Available versions

0.1.7 0.1.6 0.1.5 0.1.4 0.1.3 0.1.2 0.1.1 ~master