public class BasicPopulation extends BasicML implements Population, java.io.Serializable
| Constructor and Description |
|---|
BasicPopulation()
Construct an empty population.
|
BasicPopulation(int thePopulationSize,
GenomeFactory theGenomeFactory)
Construct a population.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all genomes from this population.
|
Species |
createSpecies()
Create a species.
|
Species |
determineBestSpecies()
Determine which species has the top genome.
|
java.util.List<Genome> |
flatten()
Flatten the species into a single list of genomes.
|
Genome |
getBestGenome() |
GenomeFactory |
getGenomeFactory() |
int |
getMaxIndividualSize() |
java.lang.String |
getName() |
int |
getPopulationSize() |
RuleHolder |
getRules() |
java.util.List<Species> |
getSpecies() |
void |
purgeInvalidGenomes()
Purge any invalid genomes.
|
void |
setBestGenome(Genome genome)
Set the best genome.
|
void |
setGenomeFactory(GenomeFactory factory)
Set the gnome factory.
|
void |
setName(java.lang.String theName)
Set the name.
|
void |
setPopulationSize(int thePopulationSize)
Set the max population size.
|
void |
setRules(RuleHolder rules)
Set the rules holder to use.
|
int |
size() |
void |
updateProperties()
Update any objeccts when a property changes.
|
getProperties, getPropertyDouble, getPropertyLong, getPropertyString, setProperty, setProperty, setPropertypublic BasicPopulation()
public BasicPopulation(int thePopulationSize,
GenomeFactory theGenomeFactory)
thePopulationSize - The population size.theGenomeFactory - factory that can be used to store create genomes.public void clear()
clear in interface Populationpublic Species createSpecies()
createSpecies in interface Populationpublic Species determineBestSpecies()
determineBestSpecies in interface Populationpublic java.util.List<Genome> flatten()
flatten in interface Populationpublic Genome getBestGenome()
getBestGenome in interface Populationpublic GenomeFactory getGenomeFactory()
getGenomeFactory in interface Populationpublic int getMaxIndividualSize()
getMaxIndividualSize in interface Populationpublic java.lang.String getName()
public int getPopulationSize()
getPopulationSize in interface Populationpublic java.util.List<Species> getSpecies()
getSpecies in interface Populationpublic void setBestGenome(Genome genome)
setBestGenome in interface Populationgenome - The best genome.public void setGenomeFactory(GenomeFactory factory)
setGenomeFactory in interface Populationfactory - The genome factory.public void setName(java.lang.String theName)
theName - The new name.public void setPopulationSize(int thePopulationSize)
setPopulationSize in interface PopulationthePopulationSize - The max population size.public int size()
size in interface Populationpublic void updateProperties()
updateProperties in interface MLPropertiesupdateProperties in class BasicMLpublic RuleHolder getRules()
getRules in interface Populationpublic void setRules(RuleHolder rules)
PopulationsetRules in interface Populationrules - the rules to setpublic void purgeInvalidGenomes()
purgeInvalidGenomes in interface Population