com.rubecula.darwin.core
Class Fitness_Default

java.lang.Object
  extended by com.rubecula.darwin.core.Fitness_Abstract
      extended by 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

Field Summary
 
Fields inherited from class com.rubecula.darwin.core.Fitness_Abstract
log
 
Constructor Summary
Fitness_Default()
           
 
Method Summary
 double getFitness(Trait trait, EcoFactor factor)
          Method to get the fitness for a Trait/EcoFactor pair.
 double getWeight(Trait trait, EcoFactor factor)
          Method to get the weight for a Trait/EcoFactor pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fitness_Default

public Fitness_Default()
Method Detail

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)