Class PSEngine
- java.lang.Object
-
- org.hortonmachine.gears.utils.optimizers.particleswarm.PSEngine
-
public class PSEngine extends Object
Particle swarm main engine.http://www.borgelt.net/psopt.html
Biblio: http://ncra.ucd.ie/COMP30290/crc2006/Olapeju_Ayoola_03304281.pdf ?
- Author:
- Andrea Antonello (www.hydrologis.com)
-
-
Constructor Summary
Constructors Constructor Description PSEngine(int particlesNum, int maxIterations, double accelerationFactorLocal, double accelerationFactorGlobal, double initDecelerationFactor, double decayFactor, IPSFunction function, String prefix)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]getSolution()Getter for the found solution.doublegetSolutionFittingValue()voidinitializeRanges(double[]... ranges)Set ranges for the parameter space.static booleanparametersInRange(double[] parameters, double[]... ranges)Checks if the parameters are in the ranges.voidrun()Run the particle swarm engine.
-
-
-
Constructor Detail
-
PSEngine
public PSEngine(int particlesNum, int maxIterations, double accelerationFactorLocal, double accelerationFactorGlobal, double initDecelerationFactor, double decayFactor, IPSFunction function, String prefix)Constructor.- Parameters:
particlesNum- number of particles involved.maxIterations- maximum iterations.accelerationFactorLocal- local acceleration factor for particles.accelerationFactorGlobal- global acceleration factor for particles.initDecelerationFactor- initial deceleration factor.decayFactor- decay factor.function- the fittingfunctionto use.prefix- TODO
-
-
Method Detail
-
initializeRanges
public void initializeRanges(double[]... ranges)
Set ranges for the parameter space.The order of the ranges needs to be the same that will be used be the particles and fitting function.
- Parameters:
ranges- the [min, max] ranges to use.
-
getSolution
public double[] getSolution()
Getter for the found solution.- Returns:
- the solution.
-
getSolutionFittingValue
public double getSolutionFittingValue()
-
parametersInRange
public static boolean parametersInRange(double[] parameters, double[]... ranges)Checks if the parameters are in the ranges.- Parameters:
parameters- the params.ranges- the ranges.- Returns:
true, if they are inside the given ranges.
-
-