Class PopulationData<T>
- java.lang.Object
-
- org.uncommons.watchmaker.framework.PopulationData<T>
-
- Type Parameters:
T
- The type of evolved entity present in the population that this data describes.
public final class PopulationData<T> extends Object
Immutable data object containing statistics about the state of an evolved population and a reference to the fittest candidate solution in the population.- See Also:
EvolutionObserver
-
-
Constructor Summary
Constructors Constructor Description PopulationData(T bestCandidate, double bestCandidateFitness, double meanFitness, double fitnessStandardDeviation, boolean naturalFitness, int populationSize, int eliteCount, int generationNumber, long elapsedTime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getBestCandidate()
double
getBestCandidateFitness()
long
getElapsedTime()
Returns the amount of time (in milliseconds) since the start of the evolutionary algorithm's execution.int
getEliteCount()
double
getFitnessStandardDeviation()
Returns a statistical measure of variation in fitness scores within the population.int
getGenerationNumber()
double
getMeanFitness()
Returns the average fitness score of population members.int
getPopulationSize()
boolean
isNaturalFitness()
Indicates whether the fitness scores are natural or non-natural.
-
-
-
Constructor Detail
-
PopulationData
public PopulationData(T bestCandidate, double bestCandidateFitness, double meanFitness, double fitnessStandardDeviation, boolean naturalFitness, int populationSize, int eliteCount, int generationNumber, long elapsedTime)
- Parameters:
bestCandidate
- The fittest candidate present in the population.bestCandidateFitness
- The fitness score for the fittest candidate in the population.meanFitness
- The arithmetic mean of fitness scores for each member of the population.fitnessStandardDeviation
- A measure of the variation in fitness scores.naturalFitness
- True if higher fitness scores are better, false otherwise.populationSize
- The number of individuals in the population.eliteCount
- The number of candidates preserved via elitism.generationNumber
- The (zero-based) number of the last generation that was processed.elapsedTime
- The number of milliseconds since the start of the
-
-
Method Detail
-
getBestCandidate
public T getBestCandidate()
- Returns:
- The fittest candidate present in the population.
- See Also:
getBestCandidateFitness()
-
getBestCandidateFitness
public double getBestCandidateFitness()
- Returns:
- The fitness score of the fittest candidate.
- See Also:
getBestCandidateFitness()
-
getMeanFitness
public double getMeanFitness()
Returns the average fitness score of population members.- Returns:
- The arithmetic mean fitness of individual candidates.
-
getFitnessStandardDeviation
public double getFitnessStandardDeviation()
Returns a statistical measure of variation in fitness scores within the population.- Returns:
- Population standard deviation for fitness scores.
-
isNaturalFitness
public boolean isNaturalFitness()
Indicates whether the fitness scores are natural or non-natural.- Returns:
- True if higher fitness scores indicate fitter individuals, false otherwise.
-
getPopulationSize
public int getPopulationSize()
- Returns:
- The number of individuals in the current population.
-
getEliteCount
public int getEliteCount()
- Returns:
- The number of candidates preserved via elitism.
-
getGenerationNumber
public int getGenerationNumber()
- Returns:
- The number of this generation (zero-based).
-
getElapsedTime
public long getElapsedTime()
Returns the amount of time (in milliseconds) since the start of the evolutionary algorithm's execution.- Returns:
- How long (in milliseconds) the algorithm has been running.
-
-