Class CouplerRandom

  • All Implemented Interfaces:
    Coupler

    public class CouplerRandom
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Random random  
    • Constructor Summary

      Constructors 
      Constructor Description
      CouplerRandom​(org.opt4j.core.common.random.Rand random)
      Constructs a CouplerRandom with a given Rand random number generator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • random

        protected final java.util.Random random
    • Constructor Detail

      • CouplerRandom

        @Inject
        public CouplerRandom​(org.opt4j.core.common.random.Rand random)
        Constructs a CouplerRandom with a given Rand random number generator.
        Parameters:
        random - the random number generator
    • Method Detail

      • getCouples

        public java.util.Collection<org.opt4j.operators.crossover.Pair<org.opt4j.core.Individual>> getCouples​(int size,
                                                                                                              java.util.List<org.opt4j.core.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