com.rubecula.darwin.core
Class Fitness_Default
java.lang.Object
com.rubecula.darwin.core.Fitness_Abstract
com.rubecula.darwin.core.Fitness_Default
- All Implemented Interfaces:
- Fitness
public final class Fitness_Default
- extends Fitness_Abstract
- implements Fitness
Default implementation of Fitness interface.
- Author:
- Robin Hillyard
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Fitness_Default
public Fitness_Default()
getFitness
public double getFitness(Trait trait,
EcoFactor factor)
- Method to get the fitness for a Trait/EcoFactor pair.
- Specified by:
getFitness in interface Fitness
- Parameters:
trait - the trait to be evaluated in the environment.factor - the environmental factor.
- Returns:
- an arbitrary value between 1 and 0 which depends on the hashcodes of the trait and factor values.
- See Also:
Fitness.getFitness(com.rubecula.darwin.core.Trait, com.rubecula.darwin.core.EcoFactor)
getWeight
public double getWeight(Trait trait,
EcoFactor factor)
- Method to get the weight for a Trait/EcoFactor pair.
- Specified by:
getWeight in interface Fitness
- Parameters:
trait - the trait to be evaluated in the environment.factor - the environmental factor.
- Returns:
- 1 (always)
- See Also:
Fitness.getWeight(com.rubecula.darwin.core.Trait, com.rubecula.darwin.core.EcoFactor)