org.dishevelled.swarm.fitness
Class RandomFitness

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

public final class RandomFitness
extends Object
implements Fitness

Random fitness function.

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

Constructor Summary
RandomFitness()
          Create a new random fitness function with a default source of randomness.
RandomFitness(Random random)
          Create a new random fitness function with the specified source of randomness.
 
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

RandomFitness

public RandomFitness()
Create a new random fitness function with a default source of randomness.


RandomFitness

public RandomFitness(Random random)
Create a new random fitness function with the specified source of randomness.

Parameters:
random - source of randomness for this random fitness funtion, 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.