Package org.opt4j.optimizer.ea
Class CouplerUnique
- java.lang.Object
-
- org.opt4j.optimizer.ea.CouplerUnique
-
- All Implemented Interfaces:
Coupler
public class CouplerUnique extends Object implements Coupler
TheCouplerUnique
uses the set of parents and creates couples randomly from this set. Parent pairs never contain equalIndividual
s.
-
-
Constructor Summary
Constructors Constructor Description CouplerUnique(Rand random)
Constructs aCouplerRandom
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Pair<Individual>>
getCouples(int size, List<Individual> parents)
Returns a list ofIndividual
-groups (couples) that are designated to create offspring.
-
-
-
Field Detail
-
random
protected final Random random
-
-
Constructor Detail
-
CouplerUnique
@Inject public CouplerUnique(Rand random)
Constructs aCouplerRandom
.- Parameters:
random
- the random number generator
-
-
Method Detail
-
getCouples
public Collection<Pair<Individual>> getCouples(int size, List<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
-
-