public class MatingCrossoverMutate extends Object implements Mating
MatingCrossoverMutate creates offspring from a given set of
parents by using Crossover and Mutate.| Constructor and Description |
|---|
MatingCrossoverMutate(Crossover<Genotype> crossover,
Mutate<Genotype> mutate,
Copy<Genotype> copy,
Coupler coupler,
CrossoverRate crossoverRate,
MutationRate mutationRate,
Rand random,
IndividualFactory individualFactory)
Constructs a
MatingCrossoverMutate with a given Crossover
, Mutate, Copy, Coupler, CrossoverRate,
Rand, and IndividualFactory. |
| Modifier and Type | Method and Description |
|---|---|
Collection<Individual> |
getOffspring(int size,
Collection<Individual> parents)
Creates offspring from a given set of parents.
|
Collection<Individual> |
getOffspring(int size,
Individual... parents)
Creates offspring from a given set of parents.
|
@Inject public MatingCrossoverMutate(Crossover<Genotype> crossover, Mutate<Genotype> mutate, Copy<Genotype> copy, Coupler coupler, CrossoverRate crossoverRate, MutationRate mutationRate, Rand random, IndividualFactory individualFactory)
MatingCrossoverMutate with a given Crossover
, Mutate, Copy, Coupler, CrossoverRate,
Rand, and IndividualFactory.crossover - the crossover operatormutate - the mutate operatorcopy - the copy operatorcoupler - the couplercrossoverRate - the used crossover ratemutationRate - the mutation raterandom - the random number generatorindividualFactory - the individual factorypublic Collection<Individual> getOffspring(int size, Individual... parents)
MatinggetOffspring in interface Matingsize - the number of individuals to createparents - the parentspublic Collection<Individual> getOffspring(int size, Collection<Individual> parents)
MatinggetOffspring in interface Matingsize - the number of individuals to createparents - the parents