org.dishevelled.swarm.fitness
Class FitnessTransform

java.lang.Object
  extended by org.dishevelled.swarm.fitness.FitnessTransform
All Implemented Interfaces:
Fitness

public final class FitnessTransform
extends Object
implements Fitness

Fitness transform.

Version:
$Revision$ $Date$
Author:
Michael Heuer

Constructor Summary
FitnessTransform(Fitness fitness, UnaryFunction<Double,Double> transform)
          Create a new fitness transform with the specified fitness function and transform function.
 
Method Summary
 double score(double[] position)
          Return a measure of fitness for the specified position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitnessTransform

public FitnessTransform(Fitness fitness,
                        UnaryFunction<Double,Double> transform)
Create a new fitness transform with the specified fitness function and transform function.

Parameters:
fitness - fitness function to transform, must not be null
transform - transform function, must not be null
Method Detail

score

public double score(double[] position)
Return a measure of fitness for the specified position. The specified array of doubles will not be null. The length of the array will be equal to the number of dimensions for the position.

Specified by:
score in interface Fitness
Parameters:
position - position
Returns:
a measure of fitness for the specified position


Copyright © 2006-2012 dishevelled.org. All Rights Reserved.