3import static org.junit.jupiter.api.Assertions.assertEquals;
6import java.util.ArrayList;
9import denoptim.graph.Candidate;
10import denoptim.programs.denovo.GAParameters;
11import denoptim.utils.Randomizer;;
23 @SuppressWarnings(
"null")
27 List<Candidate> population =
new ArrayList<>();
28 Double[] fitnesses = {3.0, 2.0, 1.1, -1.3, -2.4};
29 for (
int i=0; i<fitnesses.length; i++)
32 population.get(i).setFitness(fitnesses[i]);
49 assertEquals(sz1, selection1.length);
50 assertEquals(sz2, selection2.length);
Class that offers methods to performs fitness-driven selection of candidates.
static Candidate[] performSUS(List< Candidate > population, int sz, RunTimeParameters settings)
Stochastic Uniform Sampling Note: this implementation is based on the WATCHMAKER framework http://wat...
A candidate is the combination of a denoptim graph with molecular representation and may include also...
void setRandomizer(Randomizer rng)
Sets the randomizer.
Parameters for genetic algorithm.
Tool to generate random numbers and random decisions.