gov.nasa.javaGenes.core
Class Weighted0to1
java.lang.Object
gov.nasa.javaGenes.core.FitnessFunction
gov.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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
weights
protected ExtendedVector weights
fitnessFunctions
protected ExtendedVector fitnessFunctions
Weighted0to1
public Weighted0to1()
add
public void add(double weight,
FitnessFunction function)
- Parameters:
weight
- the weight for this fitness function. Larger values indicate more influencefunction
- 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()