|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.tostring0.AToString com.rubecula.darwin.domain.world.Organism_
public abstract class Organism_
Abstract class defining the base methods and fields of an implementation of
Organism
interface.
TODO this is a huge type file. Consider splitting up.
Field Summary | |
---|---|
protected java.lang.String |
_identifier
An identifier for this organism. |
protected Nuclear |
_nuclear
The cell (in effect the nuclear DNA) to which this organism conforms. |
protected static org.apache.commons.logging.Log |
LOG
The logger for this class. |
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 |
Organism_(java.lang.String identifier,
Colony colony,
Nuclear nuclear)
Construct a new organism with the following attributes: |
Method Summary | |
---|---|
void |
age()
Age this organism by one year. |
boolean |
censusMe(Census census,
java.lang.Object context)
There are two paths through this method: 1) if context is an instance of OrganismCensusContext , then we call
doCensusInContext(OrganismCensusContext) and consider ourselves
done (no need for going deeper through children); 2) otherwise, we output
information about this Organism and return true (OK not yet done
-- need to iterate through children). |
java.lang.Object |
clone()
|
int |
compareTo(Valuable o)
|
boolean |
equals(java.lang.Object obj)
|
int |
getAge()
|
java.util.Collection<? extends Censusible> |
getCensusibleChildren()
Method to return a list of censusible children of this object. |
Colony |
getColony()
Method to determine to which population this organism currently belongs. |
java.lang.Number |
getFitness(FitnessEngine fitnessEngine)
|
Genome |
getGenome()
|
java.lang.String |
getIdentifier()
|
protected Mortality |
getMortality()
Get the mortality for this mortal object (from the system of the colony to which this organism belongs). |
Nuclear |
getNuclear()
|
Phenotype |
getPhenotype()
Get the phenotype by expressing the genome in the context of the colony. |
java.lang.Number |
getValue()
Get the fitness for this Organism, either from the cache for the fitness engine, or by calculation. |
Visualizable |
getVisualizable()
TEST |
int |
hashCode()
|
boolean |
isMortal(double fitness)
TODO calculate fitness within this method rather than have it passed in. |
boolean |
isNew()
TEST |
boolean |
isViable()
|
boolean |
isVisible()
TEST |
void |
normalizeGenome(Genome referenceGenome,
java.util.Map<java.lang.String,Genome> cache,
Environment environment)
TODO consider adding this to the Organism interface. |
void |
onEnvironmentChange(Environment env)
flush the fitness cache completely. |
void |
setColony(Colony colony)
Reset the owning colony of this organism. |
boolean |
setViability(Viability viability)
|
void |
setViable(boolean viable)
|
Methods inherited from class net.sf.tostring0.AToString |
---|
toString, toString, toStringBrief, toStringId |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.rubecula.darwin.domain.helper.Organism |
---|
createMate, createPairBond, getAsexualProgeny |
Methods inherited from interface net.sf.tostring0.IToString |
---|
toString, toStringBrief, toStringId |
Field Detail |
---|
protected static final org.apache.commons.logging.Log LOG
protected final Nuclear _nuclear
protected final java.lang.String _identifier
Constructor Detail |
---|
protected Organism_(java.lang.String identifier, Colony colony, Nuclear nuclear)
identifier
- a string by which to identify this organism (may be null).colony
- the Population to which this specific organism belongsnuclear
- the Genome to which this organism (and all its relatives)
adheres.Method Detail |
---|
public void age()
age
in interface Mortal
Mortal.age()
public boolean censusMe(Census census, java.lang.Object context)
OrganismCensusContext
, then we call
doCensusInContext(OrganismCensusContext)
and consider ourselves
done (no need for going deeper through children); 2) otherwise, we output
information about this Organism
and return true (OK not yet done
-- need to iterate through children).
censusMe
in interface Censusible
census
- the census object which will present the results of taking
this censuscontext
- an arbitrary object which can be used by the census object to
provide appropriate context for this object.
Censusible.getCensusibleChildren()
.Censusible.censusMe(Census,
java.lang.Object)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
Object.clone()
public int compareTo(Valuable o)
compareTo
in interface java.lang.Comparable<Valuable>
Comparable.compareTo(java.lang.Object)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int getAge()
getAge
in interface Mortal
Mortal.getAge()
public java.util.Collection<? extends Censusible> getCensusibleChildren()
Censusible
getCensusibleChildren
in interface Censusible
ArrayList
of censusible objects.Censusible.getCensusibleChildren()
public Colony getColony()
Organism
getColony
in interface Organism
colony
.Organism.getColony()
public java.lang.Number getFitness(FitnessEngine fitnessEngine) throws FitnessException
getFitness
in interface Organism
fitnessEngine
-
Organism
in its Environment
.
FitnessException
Organism.getFitness(com.rubecula.darwin.domain.helper.FitnessEngine)
public Genome getGenome()
getGenome
in interface Genetic
Genetic.getGenome()
public java.lang.String getIdentifier()
getIdentifier
in interface net.sf.tostring0.Identifiable
Identifiable.getIdentifier()
public Nuclear getNuclear()
getNuclear
in interface Organism
public Phenotype getPhenotype()
getPhenotype
in interface Organism
Organism.getPhenotype()
public java.lang.Number getValue() throws ValueException
getValue
in interface Valuable
Organism
by invoking
getFitness(FitnessEngine)
and passing it the fitness
engine for the phenome for the system for the colony.
ValueException
Valuable.getValue()
public Visualizable getVisualizable()
getVisualizable
in interface Individual
Visualizable
object of which this Individual
is a member.Individual.getVisualizable()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean isMortal(double fitness)
isMortal
in interface Organism
fitness
- the fitness of the organism whose mortality we are
discovering.
public boolean isNew()
isNew
in interface Individual
Individual.isNew()
public boolean isViable()
isViable
in interface Mortal
Mortal.isViable()
public boolean isVisible()
isVisible
in interface Individual
Individual.isVisible()
public void normalizeGenome(Genome referenceGenome, java.util.Map<java.lang.String,Genome> cache, Environment environment)
Organism
interface.
normalizeGenome
in interface Organism
referenceGenome
- the genome to which this Organism
's genome will be
normalizedcache
- map of bases -> genome pairsenvironment
- the environment to which this Organism
belongs.public void onEnvironmentChange(Environment env)
onEnvironmentChange
in interface EnvironmentListener
env
- the environment which has changed.EnvironmentListener.onEnvironmentChange(com.rubecula.darwin.domain.helper.Environment)
public void setColony(Colony colony)
setColony
in interface Organism
colony
- the new population to which this organism now belongs.Organism.setColony(Colony)
public boolean setViability(Viability viability) throws FitnessException
setViability
in interface Organism
viability
- the determinant of viability for this Organism
setViable(boolean)
was invoked on this
Organism
.
FitnessException
public void setViable(boolean viable)
setViable
in interface Mortal
viable
- if false, then we (temporarily) mark this organism as not
being part of a population model.Mortal.setViable(boolean)
protected Mortality getMortality()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |