private class AggarwalYuEvolutionary.EvolutionarySearch extends Object
Modifier and Type | Field and Description |
---|---|
(package private) int |
dbsize
Database size.
|
(package private) int |
dim
Database dimensionality.
|
(package private) int |
m
m to use.
|
private Random |
random
random generator.
|
(package private) ArrayList<ArrayList<DBIDs>> |
ranges
Database ranges.
|
Constructor and Description |
---|
AggarwalYuEvolutionary.EvolutionarySearch(Relation<V> relation,
ArrayList<ArrayList<DBIDs>> ranges,
int m,
Random random)
Constructor.
|
final int dbsize
final int dim
final int m
private final Random random
public Iterable<AggarwalYuEvolutionary.Individuum> run()
private boolean checkConvergence(Collection<AggarwalYuEvolutionary.Individuum> pop)
pop
- Populationprivate ArrayList<AggarwalYuEvolutionary.Individuum> initialPopulation(int popsize)
popsize
- Population sizeprivate ArrayList<AggarwalYuEvolutionary.Individuum> rouletteRankSelection(ArrayList<AggarwalYuEvolutionary.Individuum> population)
population
- Populationprivate ArrayList<AggarwalYuEvolutionary.Individuum> mutation(ArrayList<AggarwalYuEvolutionary.Individuum> population, double perc1, double perc2)
private AggarwalYuEvolutionary.Individuum makeIndividuum(int[] gene)
gene
- Gene to evaluateprivate ArrayList<AggarwalYuEvolutionary.Individuum> crossoverOptimized(ArrayList<AggarwalYuEvolutionary.Individuum> population)
private Pair<AggarwalYuEvolutionary.Individuum,AggarwalYuEvolutionary.Individuum> recombineOptimized(AggarwalYuEvolutionary.Individuum parent1, AggarwalYuEvolutionary.Individuum parent2)
parent1
- First parentparent2
- Second parentprivate AggarwalYuEvolutionary.Individuum combineRecursive(ArrayList<Integer> r, int i, int[] current, AggarwalYuEvolutionary.Individuum parent1, AggarwalYuEvolutionary.Individuum parent2)
r
- valid positions to usei
- Offset in r to start at.current
- Current geneparent1
- First parentparent2
- Second parent