Package org.opt4j.optimizers.ea
Class MatingCrossoverMutate
java.lang.Object
org.opt4j.optimizers.ea.MatingCrossoverMutate
- All Implemented Interfaces:
Mating
The
MatingCrossoverMutate creates offspring from a given set of
parents by using Crossover and Mutate.-
Constructor Summary
ConstructorsConstructorDescriptionMatingCrossoverMutate(Crossover<Genotype> crossover, Mutate<Genotype> mutate, Copy<Genotype> copy, Coupler coupler, CrossoverRate crossoverRate, MutationRate mutationRate, Rand random, IndividualFactory individualFactory) Constructs aMatingCrossoverMutatewith a givenCrossover,Mutate,Copy,Coupler,CrossoverRate,Rand, andIndividualFactory. -
Method Summary
Modifier and TypeMethodDescriptiongetOffspring(int size, Collection<Individual> parents) Creates offspring from a given set of parents.getOffspring(int size, Individual... parents) Creates offspring from a given set of parents.
-
Constructor Details
-
MatingCrossoverMutate
@Inject public MatingCrossoverMutate(Crossover<Genotype> crossover, Mutate<Genotype> mutate, Copy<Genotype> copy, Coupler coupler, CrossoverRate crossoverRate, MutationRate mutationRate, Rand random, IndividualFactory individualFactory) Constructs aMatingCrossoverMutatewith a givenCrossover,Mutate,Copy,Coupler,CrossoverRate,Rand, andIndividualFactory.- Parameters:
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 factory
-
-
Method Details
-
getOffspring
Description copied from interface:MatingCreates offspring from a given set of parents.- Specified by:
getOffspringin interfaceMating- Parameters:
size- the number of individuals to createparents- the parents- Returns:
- the offspring
-
getOffspring
Description copied from interface:MatingCreates offspring from a given set of parents.- Specified by:
getOffspringin interfaceMating- Parameters:
size- the number of individuals to createparents- the parents- Returns:
- the offspring
-