Class IntegerGenotype

    • Constructor Detail

      • IntegerGenotype

        public IntegerGenotype​(int lowerBound,
                               int upperBound)
        Constructs a IntegerGenotype with a specified lower and upper bound for all values.
        Parameters:
        lowerBound - the lower bound
        upperBound - the upper bound
    • Method Detail

      • getLowerBound

        public int 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 int 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