public class CouplerUnique extends java.lang.Object implements Coupler
CouplerUnique
uses the set of parents and creates couples
randomly from this set. Parent pairs never contain equal Individual
s.Modifier and Type | Field and Description |
---|---|
protected java.util.Random |
random |
Constructor and Description |
---|
CouplerUnique(org.opt4j.core.common.random.Rand random)
Constructs a
CouplerRandom . |
Modifier and Type | Method and 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 of
Individual -groups (couples) that are designated
to create offspring. |
@Inject public CouplerUnique(org.opt4j.core.common.random.Rand random)
CouplerRandom
.random
- the random number generatorpublic java.util.Collection<org.opt4j.operators.crossover.Pair<org.opt4j.core.Individual>> getCouples(int size, java.util.List<org.opt4j.core.Individual> parents)
Coupler
Individual
-groups (couples) that are designated
to create offspring.getCouples
in interface Coupler
size
- the number of couples to createparents
- the parents