com.rubecula.darwin.domain.helper
Interface Organism

All Superinterfaces:
Censusible, java.lang.Comparable<Valuable>, ComparableValue, EnvironmentListener, Genetic, net.sf.tostring0.Identifiable, Individual, net.sf.tostring0.IToString, Mortal, Valuable
All Known Implementing Classes:
Organism_, Organism_Asexual, Organism_Sexual, Organism_TS

public interface Organism
extends Mortal, Genetic, net.sf.tostring0.IToString, EnvironmentListener, Censusible, ComparableValue

Defines methods on an individual organism within a Taxon. An Organism exhibits the following properties:

genome
the (possibly) unique genome for the individual, (from which may be derived a Phenotype in the context of a Genomic);
age
the age of the individual (a count of the number of times the method Mortal.age() has been called on it);
phenotype
the phenotype of this individual (not necessarily a fixed property - may be derived on the fly)
;
colony
the colony to which this organism belongs;

Version:
$Revision: 1.20 $
Author:
Robin Hillyard

Field Summary
 
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
 
Method Summary
 Mate createMate(MateChoice chooser, Organism female)
          Create a Mate object based on this (male) organism and its desirability to the given female.
 Mating createPairBond(MateChoice chooser, Lek lek, Lek alternativeLek)
           
 java.util.Collection<Organism> getAsexualProgeny(int howMany)
           
 Colony getColony()
          Method to determine to which population this organism currently belongs.
 java.lang.Number getFitness(FitnessEngine fitnessEngine)
           
 Nuclear getNuclear()
           
 Phenotype getPhenotype()
           
 boolean isMortal(double fitness)
          TODO consider change the name and sense of the result so that the method returns true if it stays alive.
 void normalizeGenome(Genome referenceGenome, java.util.Map<java.lang.String,Genome> cache, Environment environment)
           
 void setColony(Colony colony)
          Mutating method to change the current population for this organism, as a result of migration.
 boolean setViability(Viability viability)
           
 
Methods inherited from interface com.rubecula.darwin.domain.helper.Mortal
age, getAge, isViable, setViable
 
Methods inherited from interface com.rubecula.darwin.foundation.Individual
getVisualizable, isNew, isVisible
 
Methods inherited from interface com.rubecula.darwin.domain.helper.Genetic
getGenome
 
Methods inherited from interface net.sf.tostring0.IToString
toString, toStringBrief, toStringId
 
Methods inherited from interface com.rubecula.darwin.domain.helper.EnvironmentListener
onEnvironmentChange
 
Methods inherited from interface com.rubecula.darwin.domain.helper.Censusible
censusMe, getCensusibleChildren
 
Methods inherited from interface com.rubecula.darwin.foundation.Valuable
getValue
 
Methods inherited from interface net.sf.tostring0.Identifiable
getIdentifier
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

createMate

Mate createMate(MateChoice chooser,
                Organism female)
Create a Mate object based on this (male) organism and its desirability to the given female.

Parameters:
chooser - the object which will calculate the desirability of this organism to the given female.
female - the organism looking for a mate.
Returns:
if organism is male, then a newly constructed Mate based on the organism and that organism's desirability as a mate; otherwise null.

createPairBond

Mating createPairBond(MateChoice chooser,
                      Lek lek,
                      Lek alternativeLek)
Parameters:
chooser -
lek - the breeding males from which we will choose a mate
alternativeLek - may be null
Returns:
a new Mating object which is a pair bond between this organism (assuming it's a female) and a male from the population specified.

getAsexualProgeny

java.util.Collection<Organism> getAsexualProgeny(int howMany)
Parameters:
howMany - the number of progeny to be born.
Returns:
a collection of progeny from the given organism.

getColony

Colony getColony()
Method to determine to which population this organism currently belongs. Getter/setter typically called by reflection.

Returns:
the population to which this organism belongs.

getFitness

java.lang.Number getFitness(FitnessEngine fitnessEngine)
                            throws FitnessException
Parameters:
fitnessEngine -
Returns:
the fitness of this organism in its environment
Throws:
FitnessException

getNuclear

Nuclear getNuclear()
Returns:
the cellular object underlying this organism

getPhenotype

Phenotype getPhenotype()
Returns:
the phenotype for this organism.

isMortal

boolean isMortal(double fitness)
TODO consider change the name and sense of the result so that the method returns true if it stays alive.

Parameters:
fitness - the fitness of the organism whose mortality we are discovering
Returns:
true if the organism's number is up

normalizeGenome

void normalizeGenome(Genome referenceGenome,
                     java.util.Map<java.lang.String,Genome> cache,
                     Environment environment)
Parameters:
referenceGenome -
cache -
environment -

setColony

void setColony(Colony colony)
Mutating method to change the current population for this organism, as a result of migration. If this is called programatically, the call should be followed by invoking EnvironmentListener.onEnvironmentChange(Environment), although that isn't necessary when "killing" an organism. Getter/setter typically called by reflection.

Parameters:
colony - the new population to which this organism now belongs.

setViability

boolean setViability(Viability viability)
                     throws FitnessException
Parameters:
viability - XXX
Returns:
true if this Organism's viability has been reset.
Throws:
FitnessException


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