Class CouplerUnique

java.lang.Object
org.opt4j.optimizer.ea.CouplerUnique
All Implemented Interfaces:
Coupler

public class CouplerUnique extends Object implements Coupler
The CouplerUnique uses the set of parents and creates couples randomly from this set. Parent pairs never contain equal Individuals.
  • Field Details

    • random

      protected final Random random
  • Constructor Details

    • CouplerUnique

      @Inject public CouplerUnique(Rand random)
      Constructs a CouplerRandom.
      Parameters:
      random - the random number generator
  • Method Details

    • getCouples

      public Collection<Pair<Individual>> getCouples(int size, List<Individual> parents)
      Description copied from interface: Coupler
      Returns a list of Individual-groups (couples) that are designated to create offspring.
      Specified by:
      getCouples in interface Coupler
      Parameters:
      size - the number of couples to create
      parents - the parents
      Returns:
      the selected couples