Interface PopulationFitnessVector.IntegerFitness
- All Superinterfaces:
PopulationFitnessVector
- All Known Subinterfaces:
PopulationCandidates.IntegerFitness<T>
- Enclosing interface:
PopulationFitnessVector
An interface to a vector of fitnesses, each an int, of a population.
-
Nested Class Summary
Nested classes/interfaces inherited from interface PopulationFitnessVector
PopulationFitnessVector.DoubleFitness, PopulationFitnessVector.IntegerFitness -
Method Summary
Modifier and TypeMethodDescriptionintfitness(int i) Gets the fitness of a population member.of(int[] f) Creates a PopulationFitnessVector.IntegerFitness wrapping a primitive int array.default double[]Creates a new array of doubles containing the fitnesses of this PopulationFitnessVector.Integer.default int[]Creates a new array of ints containing the fitnesses of this PopulationFitnessVector.Integer.Methods inherited from interface PopulationFitnessVector
size
-
Method Details
-
fitness
int 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.
-
of
Creates a PopulationFitnessVector.IntegerFitness wrapping a primitive int array.- Parameters:
f- The int array to wrap, returned object holds a reference to f and does not clone it.- Returns:
- a PopulationFitnessVector.IntegerFitness wrapping f
-
toIntArray
default int[] toIntArray()Creates a new array of ints containing the fitnesses of this PopulationFitnessVector.Integer.- Returns:
- an array of ints
-
toDoubleArray
default double[] toDoubleArray()Creates a new array of doubles containing the fitnesses of this PopulationFitnessVector.Integer.- Returns:
- an array of doubles
-