de.kumpe.hadooptimizer.impl
Class PolynomialEvaluator
java.lang.Object
de.kumpe.hadooptimizer.impl.PolynomialEvaluator
- All Implemented Interfaces:
- Evaluator<double[]>, Serializable
public final class PolynomialEvaluator
- extends Object
- implements Evaluator<double[]>
A Evaluator
for polynomials. It's created with the roots of the
polynomial.
For the roots x1, x2, x3,... it evaluates the polynomial: f(x) = (x
- x1) * (x - x2) * (x - x3) * ...
- Author:
- Christian Kumpe
- See Also:
- Serialized Form
Method Summary |
double |
evaluate(double[] individual)
Calculates the evaluation (fitness) of the given individual . |
String |
toString()
|
PolynomialEvaluator
public PolynomialEvaluator(double... roots)
evaluate
public double evaluate(double[] individual)
- Description copied from interface:
Evaluator
- Calculates the evaluation (fitness) of the given
individual
.
A smaller value means better fitness.
- Specified by:
evaluate
in interface Evaluator<double[]>
- Parameters:
individual
- the individual to calculate the evaluation (fitness)
- Returns:
- the evaluation (fitness) of the given
individual
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2011 Christian Kumpe. All Rights Reserved.