|
||||||||||
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.foundation.Evolvable_ com.rubecula.darwin.domain.world.Population_
public abstract class Population_
Abstract class defining the base methods and fields for an instance of the
Population
interface.
Field Summary | |
---|---|
java.util.List<Colony> |
_colonies
A list of colonies. |
int |
_index
the index of this population within its taxon. |
static org.apache.commons.logging.Log |
LOG
The logger for this class. |
static java.lang.String |
S_COLON
|
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 |
Population_(java.lang.String identifier)
(Protected) constructor for Population_ where: |
Method Summary | |
---|---|
int |
addColony(Colony colony)
Add a colony to this population. |
boolean |
censusMe(Census census,
java.lang.Object context)
TODO perhaps census the colonies too? or is that taken care of with children mechanism? |
void |
cullMembers()
Method to cull all members of an Evolvable so we can make a fresh start. |
protected abstract java.lang.Object |
determineResult()
|
boolean |
equals(java.lang.Object obj)
|
java.util.Collection<? extends Censusible> |
getCensusibleChildren()
Method to return a list of censusible children of this object. |
java.util.Collection<Colony> |
getColonies()
|
Colony |
getColony(int index)
TODO consider using the id of the colony instead of the index. |
int |
getCount()
|
int |
getGeneration()
|
java.util.Collection<Individual> |
getIndividuals()
TODO is this ever actually called? Maybe we don't need this method for Population. |
Realm |
getRealm()
|
int |
getSequence()
TODO consider eliminating this and using only the generation from super-type |
Sink |
getSink()
|
Taxon |
getTaxon()
Method to get the Taxon to which this population belongs. |
int |
getTotal()
|
int |
hashCode()
|
boolean |
isFinished()
This implementation simply returns the value of the finished field. |
protected void |
midGenerationProcessing()
|
boolean |
nextGeneration()
Method to get a new generation of this population. |
protected void |
postGenerationCleanup()
|
protected void |
preGenerationPreparation()
|
void |
seedMembers()
Method to seed a this Evolvable which a certain number of
members. |
void |
setIndex(int index)
Set the index of this population within its parent Taxon System. |
void |
setTaxon(Taxon taxon)
Set the taxon to which this population belongs. |
java.lang.String |
toString(boolean showDetail,
boolean showClass,
boolean showIdentifier,
boolean includeParent,
boolean includeChildren,
java.lang.String prefix,
boolean recurse,
int maxElements,
int maxChars)
|
void |
wrapUp(java.lang.String cause)
Do nothing. |
Methods inherited from class com.rubecula.darwin.foundation.Evolvable_ |
---|
getIdentifier, getMaxGenerations, getResult, setMaxGenerations, setResult |
Methods inherited from class net.sf.tostring0.AToString |
---|
toString, toStringBrief, toStringId |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.tostring0.IToString |
---|
toStringBrief, toStringId |
Methods inherited from interface net.sf.tostring0.Identifiable |
---|
getIdentifier |
Field Detail |
---|
public final java.util.List<Colony> _colonies
public static final org.apache.commons.logging.Log LOG
public static final java.lang.String S_COLON
public transient int _index
Constructor Detail |
---|
protected Population_(java.lang.String identifier)
identifier
- is the string which will identify this population;Method Detail |
---|
public int addColony(Colony colony)
Population
addColony
in interface Population
colony
-
on {@link #_colonies}.
public boolean censusMe(Census census, java.lang.Object context)
censusMe
in interface Censusible
census
- the census objectcontext
-
public void cullMembers()
Theological
Theological.seedMembers()
.
cullMembers
in interface Theological
Theological.cullMembers()
public boolean equals(java.lang.Object obj)
equals
in class Evolvable_
Object.equals(java.lang.Object)
public java.util.Collection<? extends Censusible> getCensusibleChildren()
Censusible
getCensusibleChildren
in interface Censusible
ArrayList
of censusible objects.Censusible.getCensusibleChildren()
public java.util.Collection<Colony> getColonies()
getColonies
in interface Population
public Colony getColony(int index)
Population
getColony
in interface Population
Population.getColony(int)
public int getCount()
getCount
in interface Countable
Countable.getCount()
public int getGeneration()
getGeneration
in interface Evolvable
getGeneration
in class Evolvable_
Evolvable.getGeneration()
public java.util.Collection<Individual> getIndividuals()
getIndividuals
in interface Visualizable
Visualizable
Visualizable.getIndividuals()
public Realm getRealm()
getRealm
in interface Visualizable
Visualizable
object exists.Visualizable.getRealm()
public int getSequence()
getSequence
in interface Population
public Sink getSink()
getSink
in interface Visualizable
Visualizable.getSink()
public Taxon getTaxon()
Population
getTaxon
in interface Population
Taxon
system.Population.getTaxon()
public int getTotal()
getTotal
in interface Population
public int hashCode()
hashCode
in class Evolvable_
Object.hashCode()
public boolean isFinished()
isFinished
in interface Terminal
isFinished
in class Evolvable_
Evolvable_.maxGenerations
.
For a more complex condition, an evolvable could override this
definition.Terminal.isFinished()
public final boolean nextGeneration()
Method to get a new generation of this population. Some individuals will be culled (according to the mortality implementation, etc.); while each mating pair will produce some progeny.
Normally, this method will not be overridden by sub-classes because it contains critical logic. If you want to do additional logic, you would normally override one or more of the following methods:
Here is the exact sequence of events for this method:
sequence
preGenerationPreparation()
Colony.setupGeneration()
(once for each colony)midGenerationProcessing()
(once for each colony)
postGenerationCleanup()
isFinished()
nextGeneration
in interface Generational
nextGeneration
in class Evolvable_
isFinished()
Generational.nextGeneration()
public void seedMembers()
Theological
Evolvable
which a certain number of
members.
seedMembers
in interface Theological
Theological.seedMembers()
public void setIndex(int index)
Population
List.indexOf(Object)
.
setIndex
in interface Population
index
- the index to setpublic void setTaxon(Taxon taxon)
setTaxon
in interface Population
taxon
- public java.lang.String toString(boolean showDetail, boolean showClass, boolean showIdentifier, boolean includeParent, boolean includeChildren, java.lang.String prefix, boolean recurse, int maxElements, int maxChars)
toString
in interface net.sf.tostring0.IToString
toString
in class net.sf.tostring0.AToString
AToString.toString(boolean, boolean, boolean,
boolean, boolean, java.lang.String, boolean, int, int)
public void wrapUp(java.lang.String cause)
wrapUp
in interface Population
cause
- XXXPopulation.wrapUp(String)
protected abstract java.lang.Object determineResult()
protected void midGenerationProcessing()
protected void postGenerationCleanup()
protected void preGenerationPreparation()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |