Module org.cicirello.chips_n_salsa
Package org.cicirello.search.evo
Interface PopulationFitnessVector.Double
- All Superinterfaces:
PopulationFitnessVector
- 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 org.cicirello.search.evo.PopulationFitnessVector
PopulationFitnessVector.Double, PopulationFitnessVector.Integer
-
Method Summary
Modifier and TypeMethodDescriptiondouble
getFitness
(int i) Gets the fitness of a population member.of
(double[] f) Creates a PopulationFitnessVector.Double wrapping a primitive double array.default double[]
Creates a new array of doubles containing the elements of this PopulationFitnessVector.Double.Methods inherited from interface org.cicirello.search.evo.PopulationFitnessVector
size
-
Method Details
-
getFitness
double getFitness(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.Double 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.Double wrapping f
-
toDoubleArray
default double[] toDoubleArray()Creates a new array of doubles containing the elements of this PopulationFitnessVector.Double.- Returns:
- an array of doubles
-