Class 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 Detail

      • random

        protected final Random random
    • Constructor Detail

      • CouplerUnique

        @Inject
        public CouplerUnique​(Rand random)
        Constructs a CouplerRandom.
        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 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