GA1DArrayAlleleGenome<float>::
GA1DArrayAlleleGenome(const GAAlleleSetArray<float> & sa,
		      GAGenome::Evaluator f, void * u) :
GA1DArrayGenome<float>(sa.size(), f, u){
  naset = sa.size();
  aset = new GAAlleleSet<float>[naset];
  for(int i=0; i<naset; i++)
    aset[i] = sa.set(i);

  initializer(DEFAULT_REAL_INITIALIZER);
  mutator(DEFAULT_REAL_MUTATOR);
  comparator(DEFAULT_REAL_COMPARATOR);
  crossover(DEFAULT_REAL_CROSSOVER);
}
Beispiel #2
0
GA3DArrayAlleleGenome<T>::
GA3DArrayAlleleGenome(unsigned int w, unsigned int h, unsigned int d,
		      const GAAlleleSetArray<T> & sa,
		      GAGenome::Evaluator f, void * u) :
GA3DArrayGenome<T>(w,h,d, f, u) {
  naset = sa.size();
  aset = new GAAlleleSet<T>[naset];
  for(int i=0; i<naset; i++)
    aset[i] = sa.set(i);

  initializer(DEFAULT_3DARRAY_ALLELE_INITIALIZER);
  mutator(DEFAULT_3DARRAY_ALLELE_MUTATOR);
  comparator(DEFAULT_3DARRAY_ALLELE_COMPARATOR);
  crossover(DEFAULT_3DARRAY_ALLELE_CROSSOVER);
}