Class CouplerRandom

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

public class CouplerRandom extends Object implements Coupler
The CouplerRandom uses the set of parents and creates couples randomly from this set. In particular, there is no handling for duplicated Individuals in the parents list or in one couple.
  • Field Details

    • random

      protected final Random random
  • Constructor Details

    • CouplerRandom

      @Inject public CouplerRandom(Rand random)
      Constructs a CouplerRandom with a given Rand random number generator.
      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