Enum Class Crossover

All Implemented Interfaces:
Serializable, Comparable<Crossover>, Constable

public enum Crossover extends Enum<Crossover>
The types of crossover operation.
  • Enum Constant Details

    • SINGLE_POINT

      public static final Crossover SINGLE_POINT
      Single point crossover. A random crossover point is selected. The binary string from beginning of chromosome to the crossover point is copied from one parent. The rest is copied from the second parent.
    • TWO_POINT

      public static final Crossover TWO_POINT
      Two point crossover. Two random crossover points are selected. The binary string from beginning of chromosome to the first crossover point is copied from one parent. The part from the first to the second crossover point is copied from the second parent. The rest is copied from the first parent.
    • UNIFORM

      public static final Crossover UNIFORM
      Uniform crossover - bits are randomly copied from the first or from the second parent.
  • Method Details

    • values

      public static Crossover[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Crossover valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • apply

      public abstract BitString[] apply(BitString father, BitString mother)
      Returns a pair of offsprings by crossovering parent chromosomes.
      Parameters:
      father - the parent chromosome.
      mother - the other parent chromosome.
      Returns:
      a pair of offsprings.