All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.cilib.util.selection.recipes.RandomSelector Maven / Gradle / Ivy

Go to download

A library of composable components enabling simpler Computational Intelligence

The newest version!
/**           __  __
 *    _____ _/ /_/ /_    Computational Intelligence Library (CIlib)
 *   / ___/ / / / __ \   (c) CIRG @ UP
 *  / /__/ / / / /_/ /   http://cilib.net
 *  \___/_/_/_/_.___/
 */
package net.sourceforge.cilib.util.selection.recipes;

import net.sourceforge.cilib.util.selection.PartialSelection;
import net.sourceforge.cilib.util.selection.Selection;
import net.sourceforge.cilib.util.selection.arrangement.RandomArrangement;

/**
 * Perform a random selection from the provided list of elements.
 * 

* Random selection is performed by: *

    *
  1. A random element is selected from the provided list.
  2. *
  3. Return the result.
  4. *
* @param */ public class RandomSelector implements Selector { private static final long serialVersionUID = -5099663528040315048L; @Override public PartialSelection on(Iterable iterable) { return (Selection) Selection.copyOf(iterable).orderBy(new RandomArrangement()); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy