Package org.opt4j.operator.crossover
Class CrossoverListRate<G extends ListGenotype<?>>
java.lang.Object
org.opt4j.operator.crossover.CrossoverListRate<G>
- Direct Known Subclasses:
CrossoverBooleanRate,CrossoverIntegerRate
public abstract class CrossoverListRate<G extends ListGenotype<?>>
extends Object
implements Crossover<G>
The CrossoverListRate performs a crossover on
Genotype objects that are lists of values.
A point of crossover of the list is selected with a given rate.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCrossoverListRate(double rate, Rand random) Constructs a newCrossoverListRate. -
Method Summary
-
Field Details
-
random
-
rate
protected final double rate
-
-
Constructor Details
-
CrossoverListRate
Constructs a newCrossoverListRate.- Parameters:
rate- the rate for a crossoverrandom- the random number generator
-
-
Method Details
-
crossover
Description copied from interface:CrossoverPerforms a crossover for twoGenotypeparents. The resulting pair ofGenotypeoffspring is returned.- Specified by:
crossoverin interfaceCrossover<G extends ListGenotype<?>>- Parameters:
p1- The first parent genotype for the crossoverp2- The second parents genotype for the crossover- Returns:
- The resulting pair of offspring genotypes
-