JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.core
Class Weighted0to1

java.lang.Object
  extended bygov.nasa.javaGenes.core.FitnessFunction
      extended bygov.nasa.javaGenes.core.Weighted0to1
All Implemented Interfaces:
java.io.Serializable

public class Weighted0to1
extends FitnessFunction

this fitness function is a weighted sum of fitness functions that return 0 for perfection and 1 for worst possible

See Also:
Serialized Form

Field Summary
protected  ExtendedVector fitnessFunctions
           
protected  ExtendedVector weights
           
 
Fields inherited from class gov.nasa.javaGenes.core.FitnessFunction
name
 
Constructor Summary
Weighted0to1()
           
 
Method Summary
 void add(double weight, FitnessFunction function)
           
 Fitness evaluateFitness(Evolvable evolvable)
           
 void makeFiles()
          tells the constituent fitness functions to makeFiles()
 java.lang.String toString()
           
 
Methods inherited from class gov.nasa.javaGenes.core.FitnessFunction
bestDouble, getFunction, getName, getNameArray, isNewFunction, numberOfObjectives, report, setName, worstDouble
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

weights

protected ExtendedVector weights

fitnessFunctions

protected ExtendedVector fitnessFunctions
Constructor Detail

Weighted0to1

public Weighted0to1()
Method Detail

add

public void add(double weight,
                FitnessFunction function)
Parameters:
weight - the weight for this fitness function. Larger values indicate more influence
function - the fitness function. Must return 0 for best and 1 for worst

evaluateFitness

public Fitness evaluateFitness(Evolvable evolvable)
Specified by:
evaluateFitness in class FitnessFunction
Returns:
the fitness of evolvable.

makeFiles

public void makeFiles()
tells the constituent fitness functions to makeFiles()

Overrides:
makeFiles in class FitnessFunction

toString

public java.lang.String toString()

JavaGenes, NASA Ames. Written largely by Al Globus