de.kumpe.hadooptimizer.impl
Class PolynomialEvaluator

java.lang.Object
  extended by 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

Constructor Summary
PolynomialEvaluator(double... roots)
           
 
Method Summary
 double evaluate(double[] individual)
          Calculates the evaluation (fitness) of the given individual.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PolynomialEvaluator

public PolynomialEvaluator(double... roots)
Method Detail

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.