com.rubecula.darwin.domain.environment
Class ExPhen_

java.lang.Object
  extended by net.sf.tostring0.AToString
      extended by com.rubecula.darwin.domain.environment.ExPhen_
All Implemented Interfaces:
ExPhen, Expression, net.sf.tostring0.IToString
Direct Known Subclasses:
ExPhen_Castor, ExPhen_TS

public abstract class ExPhen_
extends net.sf.tostring0.AToString
implements ExPhen

Base implementation of an extended phenotype. TODO consider removing the EcoFactor part. Do we really need that?

Author:
Robin Hillyard

Field Summary
protected static org.apache.commons.logging.Log LOG
           
 
Fields inherited from interface net.sf.tostring0.IToString
ANGBR_OPEN, ANGBRA_CLSE, BRA_CLSE, BRA_OPEN, BRCE_OPEN, BRCS_CLSE, COLON, LIST_SEPARATOR, MAX_ELEMENTS_DEFAULT, S_MT, S_PERCENT, SEPARATOR, SPACE
 
Constructor Summary
protected ExPhen_(EcoFactor factor, java.lang.Object value)
           
 
Method Summary
 boolean applyToEnvironment(java.lang.Object criterion)
          XXX we really must check that the best organism actually has the best travel time (because of the way fitness is calculated, it's possible that it actually is worse).
protected  boolean evaluate(java.lang.Object criterion)
          This method is used to determine whether there should be follow-up action on the processing of this ExPhen object.
 EcoFactor getEcoFactor()
           
protected  EcoFactor getRevisedFactor()
          Method to get an updated eco factor for this ExPhen object which will be suitable to substitute in the environment as the outcome of processing this extended phenotype.
 java.lang.Object getValue()
           
protected  void postProcess(EcoFactor factor, java.lang.Object value)
          Method which is called as a post-processor as the final step of ExPhen.applyToEnvironment(Object).
 
Methods inherited from class net.sf.tostring0.AToString
toString, toString, toStringBrief, toStringId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
Constructor Detail

ExPhen_

protected ExPhen_(EcoFactor factor,
                  java.lang.Object value)
Parameters:
factor - the factor for this extended phenotype.
value - XXX
Method Detail

applyToEnvironment

public boolean applyToEnvironment(java.lang.Object criterion)
XXX we really must check that the best organism actually has the best travel time (because of the way fitness is calculated, it's possible that it actually is worse). We do currently check, but if it is worse, we need to adjust the parameters in RouteFitness (via configuration) [which, obviously, we don't do here].

Specified by:
applyToEnvironment in interface ExPhen
Parameters:
criterion - the value which will be used to determine if we should update the ecoFactor referenced by this ExPhen object. The higher this value, the more likely the update will occur.
Returns:
true if the environment has been updated.
See Also:
ExPhen.applyToEnvironment(Object)

getEcoFactor

public EcoFactor getEcoFactor()
Specified by:
getEcoFactor in interface ExPhen
Returns:
a modified version of one of the eco factors belonging to the environment in which the expressed Genome resides.
See Also:
ExPhen.getEcoFactor()

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface ExPhen
Returns:
the "value" of this extended phenotype.
See Also:
ExPhen.getValue()

evaluate

protected boolean evaluate(java.lang.Object criterion)
This method is used to determine whether there should be follow-up action on the processing of this ExPhen object. By convention, this method returns true only if derived value is less than criterion. It should be overridden by concrete implementers of ExPhen.

Parameters:
criterion - the higher this value, the more likely the method will return true, in general.
Returns:
true always returned by this base method.

getRevisedFactor

protected EcoFactor getRevisedFactor()
Method to get an updated eco factor for this ExPhen object which will be suitable to substitute in the environment as the outcome of processing this extended phenotype. This method should be overridden by concrete implementers of ExPhen.

Returns:
null

postProcess

protected void postProcess(EcoFactor factor,
                           java.lang.Object value)
Method which is called as a post-processor as the final step of ExPhen.applyToEnvironment(Object). By default, this method does nothing. Concrete implementations of ExPhen should consider overriding this method.

Parameters:
factor - the eco factor
value -


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