com.rubecula.darwin.domain.helper
Interface Fitness

All Known Implementing Classes:
Fitness_, Fitness_Hamiltonian, RouteFitness, WcSdFitness

public interface Fitness

Type representing a pair whose mutual fitness can be estimated. The pair is one Variant and one EcoFactor. They maybe be orthogonal, in which case their weight will be zero. Or they maybe be relevant in which case their weight will be non-zero and their fitness will be a value between 0 and 1.

Author:
Robin Hillyard

Method Summary
 int compare(double fitness1, double fitness2)
          Compare fitness 1 with fitness 2 (fitter values are higher values).
 java.lang.Number getEnvironmentFactor()
           
 double getFitness(Trait trait, EcoFactor factor)
           
 int getWeight(java.lang.String character, EcoFactor factor)
           
 void resetAdjustment(java.lang.Number adjustment, java.lang.String trait)
          Scale the current adjustment by the factor passed in.
 void resetEnvironmentFactor(java.lang.String trait, EcoFactor factor)
           
 

Method Detail

compare

int compare(double fitness1,
            double fitness2)
Compare fitness 1 with fitness 2 (fitter values are higher values).

Parameters:
fitness1 -
fitness2 -
Returns:
-1 if fitness1 is greater than fitness2, etc.

getEnvironmentFactor

java.lang.Number getEnvironmentFactor()
Returns:
the value that is dependent on the environment

getFitness

double getFitness(Trait trait,
                  EcoFactor factor)
                  throws FitnessException
Parameters:
trait -
factor -
Returns:
the fitness between 0 (unfit) and 1 (perfect fit).
Throws:
FitnessException

getWeight

int getWeight(java.lang.String character,
              EcoFactor factor)
Parameters:
character - the identifier (or key) of the phenotypic character whose traits/variants will be measured for fitness against the given factor.
factor -
Returns:
the relative weighting for this fitness (0: not a significant fitness match)

resetAdjustment

void resetAdjustment(java.lang.Number adjustment,
                     java.lang.String trait)
Scale the current adjustment by the factor passed in.

Parameters:
adjustment - if 1 is passed in then nothing changes.
trait - XXX

resetEnvironmentFactor

void resetEnvironmentFactor(java.lang.String trait,
                            EcoFactor factor)
Parameters:
trait - XXX
factor - XXX


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.