Package smile.gap
Enum Class Crossover
- All Implemented Interfaces:
Serializable
,Comparable<Crossover>
,Constable
The types of crossover operation.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionSingle point crossover - one crossover point is selected, 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 crossover - two crossover point are selected, 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 and the rest is copied from the first parent.Uniform crossover - bits are randomly copied from the first or from the second parent. -
Method Summary
Modifier and TypeMethodDescriptionabstract BitString[]
Returns a pair of offsprings by crossovering parent chromosomes.static Crossover
Returns the enum constant of this class with the specified name.static Crossover[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SINGLE_POINT
Single point crossover - one crossover point is selected, 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
Two point crossover - two crossover point are selected, 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 and the rest is copied from the first parent. -
UNIFORM
Uniform crossover - bits are randomly copied from the first or from the second parent.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
apply
Returns a pair of offsprings by crossovering parent chromosomes.- Parameters:
father
- the parent chromosome.mother
- the other parent chromosome.- Returns:
- a pair of offsprings.
-