org.dishevelled.swarm.fitness
Class UniformFitness

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

public final class UniformFitness
extends Object
implements Fitness

Uniform fitness function.

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

Field Summary
(package private) static double DEFAULT_SCORE
          Default score.
 
Constructor Summary
UniformFitness()
          Create a new uniform fitness function with the default score of 1.0d.
UniformFitness(double score)
          Create a new uniform fitness function with the specified score.
 
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
 

Field Detail

DEFAULT_SCORE

static final double DEFAULT_SCORE
Default score.

See Also:
Constant Field Values
Constructor Detail

UniformFitness

public UniformFitness()
Create a new uniform fitness function with the default score of 1.0d.


UniformFitness

public UniformFitness(double score)
Create a new uniform fitness function with the specified score.

Parameters:
score - score for this uniform fitness function
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.