functions::RealVector CRGenetics::geneToVector(const GARealGenome& gen)
{
  functions::RealVector v(gen.size());
  for (unsigned int i = 0; i < gen.size(); i++) {
    v[i] = gen.gene(i);
  }
  return v;
}
Exemple #2
0
void GARealGenome::copy(GARealGenome b){
this->y_factor=b.y_factor;
this->genome.resize(b.size());
vector<double>::iterator pgene=this->genome.begin();
vector<double>::iterator pgeneb=b.genome.begin();
while(pgene != this->genome.end()) {
	*pgene++ =fabs(fmod(*pgeneb++ +dgene,dgene2)-dgene);
	}
	/*
this->gene_min=b.gene_min;
this->gene_max=b.gene_max;
this->dgene=b.dgene;
*/
}