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

org.evosuite.ga.operators.selection.RandomKSelection Maven / Gradle / Ivy

The newest version!
package org.evosuite.ga.operators.selection;

import org.evosuite.ga.Chromosome;
import org.evosuite.utils.Randomness;

import java.util.List;

/**
 * Select random individual
 */
public class RandomKSelection extends SelectionFunction {

    @Override
    public int getIndex(List population) {
        double r = Randomness.nextDouble();

        return (int) (r * population.size());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy