Package org.opt4j.optimizers.ea
Class CouplerUnique
- java.lang.Object
-
- org.opt4j.optimizers.ea.CouplerUnique
-
- All Implemented Interfaces:
Coupler
public class CouplerUnique extends java.lang.Object implements Coupler
TheCouplerUnique
uses the set of parents and creates couples randomly from this set. Parent pairs never contain equalIndividual
s.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Random
random
-
Constructor Summary
Constructors Constructor Description CouplerUnique(org.opt4j.core.common.random.Rand random)
Constructs aCouplerRandom
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<org.opt4j.operators.crossover.Pair<org.opt4j.core.Individual>>
getCouples(int size, java.util.List<org.opt4j.core.Individual> parents)
Returns a list ofIndividual
-groups (couples) that are designated to create offspring.
-
-
-
Constructor Detail
-
CouplerUnique
@Inject public CouplerUnique(org.opt4j.core.common.random.Rand random)
Constructs aCouplerRandom
.- Parameters:
random
- the random number generator
-
-
Method Detail
-
getCouples
public java.util.Collection<org.opt4j.operators.crossover.Pair<org.opt4j.core.Individual>> getCouples(int size, java.util.List<org.opt4j.core.Individual> parents)
Description copied from interface:Coupler
Returns a list ofIndividual
-groups (couples) that are designated to create offspring.- Specified by:
getCouples
in interfaceCoupler
- Parameters:
size
- the number of couples to createparents
- the parents- Returns:
- the selected couples
-
-