Interface PopulationFitnessVector.IntegerFitness

All Superinterfaces:
PopulationFitnessVector
All Known Subinterfaces:
PopulationCandidates.IntegerFitness<T>
Enclosing interface:
PopulationFitnessVector

public static interface PopulationFitnessVector.IntegerFitness extends PopulationFitnessVector
An interface to a vector of fitnesses, each an int, of a population.
  • 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.
    • fitnessAsDouble

      default double fitnessAsDouble(int i)
      Description copied from interface: PopulationFitnessVector
      The fitness of the a member of the population represented as a double. For implementations of the PopulationFitnessVector.DoubleFitness interface, this is the same as the PopulationFitnessVector.DoubleFitness.fitness(int) method. For implementations of the PopulationFitnessVector.IntegerFitness interface, this method simply returns 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:
      fitnessAsDouble in interface PopulationFitnessVector
      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