org.encog.ml.ea.population
public class BasicPopulation extends BasicML implements Population, 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.
|
List<Genome> |
flatten()
Flatten the species into a single list of genomes.
|
Genome |
getBestGenome() |
GenomeFactory |
getGenomeFactory() |
int |
getMaxIndividualSize() |
String |
getName() |
int |
getPopulationSize() |
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(String theName)
Set the name.
|
void |
setPopulationSize(int thePopulationSize)
Set the max population size.
|
int |
size() |
void |
updateProperties()
Update any objeccts when a property changes.
|
getProperties, getPropertyDouble, getPropertyLong, getPropertyString, setProperty, setProperty, setProperty
public BasicPopulation()
public BasicPopulation(int thePopulationSize, GenomeFactory theGenomeFactory)
thePopulationSize
- The population size.public void clear()
clear
in interface Population
public Species createSpecies()
createSpecies
in interface Population
public Species determineBestSpecies()
determineBestSpecies
in interface Population
public List<Genome> flatten()
flatten
in interface Population
public Genome getBestGenome()
getBestGenome
in interface Population
public GenomeFactory getGenomeFactory()
getGenomeFactory
in interface Population
public int getMaxIndividualSize()
getMaxIndividualSize
in interface Population
public String getName()
public int getPopulationSize()
getPopulationSize
in interface Population
public List<Species> getSpecies()
getSpecies
in interface Population
public void setBestGenome(Genome genome)
setBestGenome
in interface Population
genome
- The best genome.public void setGenomeFactory(GenomeFactory factory)
setGenomeFactory
in interface Population
factory
- The genome factory.public void setName(String theName)
theName
- The new name.public void setPopulationSize(int thePopulationSize)
setPopulationSize
in interface Population
thePopulationSize
- The max population size.public int size()
size
in interface Population
public void updateProperties()
updateProperties
in interface MLProperties
updateProperties
in class BasicML
public void purgeInvalidGenomes()
purgeInvalidGenomes
in interface Population
Copyright © 2014. All Rights Reserved.