T
- The type of evolvable entity created by the factory.public interface CandidateFactory<T>
AbstractCandidateFactory
and
implement the method to generate a single random candidate.Modifier and Type | Method and Description |
---|---|
List<T> |
generateInitialPopulation(int populationSize,
Collection<T> seedCandidates,
Random rng)
Sometimes it is desirable to seed the initial population with some
known good candidates, or partial solutions, in order to provide some
hints for the evolution process.
|
List<T> |
generateInitialPopulation(int populationSize,
Random rng)
Creates an initial population of candidates.
|
T |
generateRandomCandidate(Random rng)
Randomly create a single candidate solution.
|
List<T> generateInitialPopulation(int populationSize, Random rng)
generateInitialPopulation(int,Collection,Random)
method.populationSize
- The number of candidates to create.rng
- The random number generator to use when creating the initial
candidates.List<T> generateInitialPopulation(int populationSize, Collection<T> seedCandidates, Random rng)
populationSize
- The size of the initial population.seedCandidates
- Candidates to seed the population with. Number
of candidates must be no bigger than the population size.rng
- The random number generator to use when creating additional
candidates to fill the population when the number of seed candidates is
insufficient. This can be null if and only if the number of seed
candidates provided is sufficient to fully populate the initial population.