3import static org.junit.jupiter.api.Assertions.assertEquals;
6import java.util.ArrayList;
9import denoptim.graph.Candidate;
10import denoptim.programs.RunTimeParameters;
11import denoptim.programs.denovo.GAParameters;
12import denoptim.utils.Randomizer;;
24 @SuppressWarnings(
"null")
28 List<Candidate> population =
new ArrayList<>();
29 Double[] fitnesses = {3.0, 2.0, 1.1, -1.3, -2.4};
30 for (
int i=0; i<fitnesses.length; i++)
33 population.get(i).setFitness(fitnesses[i]);
50 assertEquals(sz1, selection1.length);
51 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.