Class DoubleGenotype

All Implemented Interfaces:
Serializable, Cloneable, Iterable<Double>, Collection<Double>, List<Double>, RandomAccess, Genotype, ListGenotype<Double>
Direct Known Subclasses:
DoubleMapGenotype

public class DoubleGenotype extends ArrayList<Double> implements ListGenotype<Double>
The DoubleGenotype consists of double values that can be used as a Genotype.
See Also:
  • Field Details

  • Constructor Details

    • DoubleGenotype

      public DoubleGenotype()
      Constructs a DoubleGenotype with lower bounds 0.0 and upper bounds 1.0.
    • DoubleGenotype

      public DoubleGenotype(double lowerBound, double upperBound)
      Constructs a DoubleGenotype with a specified lower and upper bound for all values.
      Parameters:
      lowerBound - the lower bound
      upperBound - the upper bound
    • DoubleGenotype

      public DoubleGenotype(Bounds<Double> bounds)
      Constructs a DoubleGenotype with the given Bounds.
      Parameters:
      bounds - the bounds
  • Method Details

    • getLowerBound

      public double getLowerBound(int index)
      Returns the lower bound for the i-th element.
      Parameters:
      index - the i-th element
      Returns:
      the lower bound of the i-th element
    • getUpperBound

      public double getUpperBound(int index)
      Returns the upper bound for the i-th element.
      Parameters:
      index - the i-th element
      Returns:
      the upper bound of the i-th element
    • newInstance

      public <G extends Genotype> G newInstance()
      Description copied from interface: Genotype
      Constructs a new (empty) instance of this Genotype.
      Specified by:
      newInstance in interface Genotype
      Type Parameters:
      G - the type of genotype for an implicit cast
      Returns:
      new instance of the genotype
    • init

      public void init(Random random, int n)
      Initialize this genotype with n random values.
      Parameters:
      random - the random number generator
      n - the number of elements in the resulting genotype