Interface PopulationFitnessVector
- All Known Subinterfaces:
PopulationCandidates<T>, PopulationCandidates.DoubleFitness<T>, PopulationCandidates.IntegerFitness<T>, PopulationFitnessVector.DoubleFitness, PopulationFitnessVector.IntegerFitness
public interface PopulationFitnessVector
An interface to a vector of fitnesses of a population.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn interface to a vector of fitnesses, each a double, of a population.static interfaceAn interface to a vector of fitnesses, each an int, of a population. -
Method Summary
Modifier and TypeMethodDescriptiondoublefitnessAsDouble(int i) The fitness of the a member of the population represented as a double.intsize()The size of the population.
-
Method Details
-
size
int size()The size of the population.- Returns:
- the size of the population
-
fitnessAsDouble
double fitnessAsDouble(int i) The fitness of the a member of the population represented as a double. For implementations of thePopulationFitnessVector.DoubleFitnessinterface, this is the same as thePopulationFitnessVector.DoubleFitness.fitness(int)method. For implementations of thePopulationFitnessVector.IntegerFitnessinterface, this method simply returnsPopulationFitnessVector.IntegerFitness.fitness(int). This method is provided as a convenience for cases where you cannot exploit integer-valued fitnesses for code optimization. Thus utilizing the fitnessAsDouble method may lead to simplified code.- Parameters:
i- The index into the population, which must be in the interval [0, size()).- Returns:
- the fitness of population member i.
-