T
- The type of entity evolved by this engine.public abstract class AbstractCandidateFactory<T> extends Object implements CandidateFactory<T>
CandidateFactory
.Constructor and Description |
---|
AbstractCandidateFactory() |
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)
Randomly, create an initial population of candidates.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateRandomCandidate
public List<T> generateInitialPopulation(int populationSize, Random rng)
generateInitialPopulation(int,Collection,Random)
method.generateInitialPopulation
in interface CandidateFactory<T>
populationSize
- The number of candidates to randomly create.rng
- The random number generator to use when creating the random
candidates.public List<T> generateInitialPopulation(int populationSize, Collection<T> seedCandidates, Random rng)
CandidateFactory.generateRandomCandidate(Random)
method.generateInitialPopulation
in interface CandidateFactory<T>
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.