Interface PopulationFitnessVector.DoubleFitness
- All Superinterfaces:
PopulationFitnessVector
- All Known Subinterfaces:
PopulationCandidates.DoubleFitness<T>
- Enclosing interface:
PopulationFitnessVector
An interface to a vector of fitnesses, each a double, of a population.
-
Nested Class Summary
Nested classes/interfaces inherited from interface PopulationFitnessVector
PopulationFitnessVector.DoubleFitness, PopulationFitnessVector.IntegerFitness -
Method Summary
Modifier and TypeMethodDescriptiondoublefitness(int i) Gets the fitness of a population member.default doublefitnessAsDouble(int i) The fitness of the a member of the population represented as a double.of(double[] f) Creates a PopulationFitnessVector.DoubleFitness wrapping a primitive double array.default double[]Creates a new array of doubles containing the fitnesses of this PopulationFitnessVector.Double.Methods inherited from interface PopulationFitnessVector
size
-
Method Details
-
fitness
double fitness(int i) Gets the fitness of a population member.- Parameters:
i- The index into the population, which must be in the interval [0, size()).- Returns:
- the fitness of population member i.
-
fitnessAsDouble
default double fitnessAsDouble(int i) Description copied from interface:PopulationFitnessVectorThe fitness of the a member of the population represented as a double. For implementations of thePopulationFitnessVector.DoubleFitnessinterface, this is the same as thefitness(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.- Specified by:
fitnessAsDoublein interfacePopulationFitnessVector- Parameters:
i- The index into the population, which must be in the interval [0, size()).- Returns:
- the fitness of population member i.
-
of
Creates a PopulationFitnessVector.DoubleFitness wrapping a primitive double array.- Parameters:
f- The double array to wrap, returned object holds a reference to f and does not clone it.- Returns:
- a PopulationFitnessVector.DoubleFitness wrapping f
-
toDoubleArray
default double[] toDoubleArray()Creates a new array of doubles containing the fitnesses of this PopulationFitnessVector.Double.- Returns:
- an array of doubles
-