Package org.opt4j.optimizer.ea
Class CouplerRandom
java.lang.Object
org.opt4j.optimizer.ea.CouplerRandom
- All Implemented Interfaces:
Coupler
The
CouplerRandom
uses the set of parents and creates couples
randomly from this set. In particular, there is no handling for duplicated
Individual
s in the parents list or in one couple.-
Field Summary
-
Constructor Summary
ConstructorDescriptionCouplerRandom
(Rand random) Constructs aCouplerRandom
with a givenRand
random number generator. -
Method Summary
Modifier and TypeMethodDescriptiongetCouples
(int size, List<Individual> parents) Returns a list ofIndividual
-groups (couples) that are designated to create offspring.
-
Field Details
-
random
-
-
Constructor Details
-
CouplerRandom
Constructs aCouplerRandom
with a givenRand
random number generator.- Parameters:
random
- the random number generator
-
-
Method Details
-
getCouples
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
-