|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.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 Populationcolony -
on {@link #_colonies}.
public boolean censusMe(Census census,
java.lang.Object context)
censusMe in interface Censusiblecensus - the census objectcontext -
public void cullMembers()
TheologicalTheological.seedMembers().
cullMembers in interface TheologicalTheological.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 CensusibleArrayList of censusible objects.Censusible.getCensusibleChildren()public java.util.Collection<Colony> getColonies()
getColonies in interface Populationpublic Colony getColony(int index)
Population
getColony in interface PopulationPopulation.getColony(int)public int getCount()
getCount in interface CountableCountable.getCount()public int getGeneration()
getGeneration in interface EvolvablegetGeneration in class Evolvable_Evolvable.getGeneration()public java.util.Collection<Individual> getIndividuals()
getIndividuals in interface VisualizableVisualizableVisualizable.getIndividuals()public Realm getRealm()
getRealm in interface VisualizableVisualizable object exists.Visualizable.getRealm()public int getSequence()
getSequence in interface Populationpublic Sink getSink()
getSink in interface VisualizableVisualizable.getSink()public Taxon getTaxon()
Population
getTaxon in interface PopulationTaxon system.Population.getTaxon()public int getTotal()
getTotal in interface Populationpublic int hashCode()
hashCode in class Evolvable_Object.hashCode()public boolean isFinished()
isFinished in interface TerminalisFinished 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:
sequencepreGenerationPreparation()Colony.setupGeneration() (once for each colony)midGenerationProcessing()(once for each colony)postGenerationCleanup()isFinished()
nextGeneration in interface GenerationalnextGeneration in class Evolvable_isFinished()Generational.nextGeneration()public void seedMembers()
TheologicalEvolvable which a certain number of
members.
seedMembers in interface TheologicalTheological.seedMembers()public void setIndex(int index)
PopulationList.indexOf(Object).
setIndex in interface Populationindex - the index to setpublic void setTaxon(Taxon taxon)
setTaxon in interface Populationtaxon -
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.IToStringtoString in class net.sf.tostring0.AToStringAToString.toString(boolean, boolean, boolean,
boolean, boolean, java.lang.String, boolean, int, int)public void wrapUp(java.lang.String cause)
wrapUp in interface Populationcause - 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 | |||||||||