Optimizations

The following is how you can use the Particle Swarm Optimizer to return the result that best minimizes the provided function:

var parameters = new ParameterBounds[]
{
new ParameterBounds(-10.0, 10.0, Transform.Linear),
new ParameterBounds(-10.0, 10.0, Transform.Linear),
new ParameterBounds(-10.0, 10.0, Transform.Linear),
};
var sut = new ParticleSwarmOptimizer(parameters, 100);
var actual = sut.OptimizeBest(Minimize);

The following is how you can use the Grid Search Optimizer to optimize by trying all combinations of the provided parameters:

var parameters = new double[][] { new double[]{ 10.0, 20.0, 30.0, 35.0, 37.5, 40.0, 50.0, 60.0 } };
var sut = new GridSearchOptimizer(parameters);
var actual = sut.OptimizeBest(Minimize);

The following is how you can use the Random Search Optimizer to initialize random parameters between the min and max provided. The result that best minimizes the provided function will be returned:

var parameters = new ParameterBounds[] 
{
new ParameterBounds(0.0, 100.0, Transform.Linear)
};
var sut = new RandomSearchOptimizer(parameters, 100);
var actual = sut.OptimizeBest(Minimize);
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset