535 lines
18 KiB
C++
535 lines
18 KiB
C++
#include "Processor.h"
|
|
#include "Settings.h"
|
|
#include "../population/Population.h"
|
|
#include "../individual/Phenotype.h"
|
|
#include "../individual/genome/strategies/GenotypeToPhenotypeStrategy.h"
|
|
#include <fstream>
|
|
#include <string>
|
|
#include <sstream>
|
|
#include <QGlobal.h>
|
|
#include <QTime>
|
|
#include <QVector>
|
|
#include <QString>
|
|
|
|
AsexualPopulation* Processor::popul;
|
|
//std::vector<Individual*> Processor::individs;
|
|
|
|
void Processor::test(/*int initPSize, int steps*/){
|
|
std::ofstream statFile("statFile.txt");
|
|
std::string stat;
|
|
|
|
// Èíèöèàëèçàöèÿ
|
|
int maxGenerations = Settings::Iterations;
|
|
int initPopSize = Settings::InitPopSize;
|
|
|
|
AsexualPopulation population(initPopSize);
|
|
population.setBreedingStrategy(PopulationBreedingStrategy::getInstance(Settings::BreedingStrategy));
|
|
|
|
// Èòåðàöèîííûé öèêë
|
|
for(int i = 0; i < maxGenerations; i++){
|
|
// Ïîêóøàòü (ïîêà íè÷åãî äåëàòü íå íàäî)
|
|
|
|
// Èñïûòàòü ýôôåêò ñðåäû
|
|
population.calculateFitnessAll();
|
|
|
|
// Ðàçìíîæèòü
|
|
population.breedAll();
|
|
|
|
// Ìóòàöèè
|
|
population.mutationAll();
|
|
|
|
// Ìèãðàöèÿ (ïîêà íåò)
|
|
|
|
// Ñìîäåëèðîâàòü îòáîð (ñëó÷àéíàÿ ñìåðòíîñòü è ò.ä.)
|
|
population.selectionAll();
|
|
|
|
//--- Ñòàòèñòèêà ---
|
|
stat = population.getSatistics();
|
|
statFile<<stat<<std::endl;
|
|
|
|
if(Settings::WRITE_FULL_STATISTICS_TO_FILE){
|
|
std::stringstream ss;
|
|
ss<<"generation."<<(i)<<".txt";
|
|
std::ofstream genFile(ss.str().c_str());
|
|
population.putGeneticStatisticsToStream(genFile);
|
|
genFile.close();
|
|
}
|
|
//------------------
|
|
}
|
|
statFile.close();
|
|
}
|
|
|
|
void Processor::test01(/*int initPSize, int steps*/){
|
|
std::ofstream statFile("statFile.txt");
|
|
std::string stat;
|
|
|
|
// Èíèöèàëèçàöèÿ
|
|
int maxGenerations = Settings::Iterations;
|
|
long initPopSize = Settings::InitPopSize;
|
|
long int maxIndivids = Settings::KMaxParameter;
|
|
|
|
Position3D<double> position(0, 0, 0, 1000, 1000, 1000);
|
|
Region region(position, maxIndivids);
|
|
|
|
AsexualPopulation population(initPopSize);
|
|
population.setBreedingStrategy(PopulationBreedingStrategy::getInstance(Settings::BreedingStrategy));
|
|
population.setRegion(®ion);
|
|
|
|
// Èòåðàöèîííûé öèêë
|
|
for(int i = 0; i < maxGenerations; i++){
|
|
// Ïîêóøàòü (ïîêà íè÷åãî äåëàòü íå íàäî)
|
|
|
|
// Èñïûòàòü ýôôåêò ñðåäû
|
|
population.calculateFitnessAll();
|
|
|
|
// Ðàçìíîæèòü
|
|
population.breedAll();
|
|
|
|
// Ìóòàöèè
|
|
population.mutationAll();
|
|
|
|
// Ìèãðàöèÿ (ïîêà íåò)
|
|
|
|
// Ñìîäåëèðîâàòü îòáîð (ñëó÷àéíàÿ ñìåðòíîñòü è ò.ä.)
|
|
population.selectionAll();
|
|
|
|
//--- Ñòàòèñòèêà ---
|
|
stat = population.getSatistics();
|
|
statFile<<stat<<std::endl;
|
|
|
|
if(Settings::WRITE_FULL_STATISTICS_TO_FILE){
|
|
std::stringstream ss;
|
|
ss<<"generation."<<(i)<<".txt";
|
|
std::ofstream genFile(ss.str().c_str());
|
|
population.putGeneticStatisticsToStream(genFile);
|
|
genFile.close();
|
|
}
|
|
//------------------
|
|
}
|
|
statFile.close();
|
|
}
|
|
|
|
///
|
|
void Processor::testInOutBreeding01(){
|
|
std::ofstream statFile("statFile.txt");
|
|
std::string stat;
|
|
std::cout << "breed" << std::endl;
|
|
// Èíèöèàëèçàöèÿ
|
|
int maxGenerations = Settings::Iterations;
|
|
long initPopSize = Settings::InitPopSize;
|
|
long int maxIndivids = Settings::KMaxParameter;
|
|
|
|
Position3D<double> position(0, 0, 0, 1000, 1000, 1000);
|
|
Region region(position, maxIndivids);
|
|
|
|
|
|
qsrand(0);
|
|
int RANGE = 1000;
|
|
int PRECISION = 10;
|
|
float gValue;
|
|
|
|
std::vector<Individual*> individs;
|
|
// Ñòîõàñòè÷åñêîå ñîçäàíèå ïîïóëÿöèè
|
|
for(int i = 0; i < maxIndivids/2; i++){
|
|
// Ãåíîì
|
|
std::vector<Chromosome> fGenome;
|
|
std::vector<Chromosome> mGenome;
|
|
|
|
std::vector<Chromosome> chroms;
|
|
for(int j = 0; j < 2; j++){
|
|
// Îäíà õðîìîñîìà ñ øåñòüþ ãåíàìè
|
|
RANGE = 10;
|
|
gValue = (float)(qrand()%(RANGE*PRECISION+1))/PRECISION;
|
|
Gene geneF1(Gene::Continious, "A coadaptive", gValue);
|
|
gValue = (float)(rand()%(RANGE*PRECISION+1))/PRECISION;
|
|
Gene geneF2(Gene::Continious, "B coadaptive", gValue);
|
|
|
|
RANGE = 2;
|
|
gValue = (rand()%(RANGE + 1)) / (float) RANGE;
|
|
Gene geneF3(Gene::Continious, "C disease", gValue);
|
|
gValue = (rand()%(RANGE + 1)) / (float) RANGE;
|
|
Gene geneF4(Gene::Continious, "D disease", gValue);
|
|
gValue = (rand()%(RANGE + 1)) / (float) RANGE;
|
|
Gene geneF5(Gene::Continious, "E disease", gValue);
|
|
gValue = (rand()%(RANGE + 1)) / (float) RANGE;
|
|
Gene geneF6(Gene::Continious, "F disease", gValue);
|
|
|
|
Chromosome chromF("Chrom 1"); // ïàïà / ìàìà
|
|
chromF.insertGeneToEnd(geneF1);
|
|
chromF.insertGeneToEnd(geneF2);
|
|
chromF.insertGeneToEnd(geneF3);
|
|
chromF.insertGeneToEnd(geneF4);
|
|
chromF.insertGeneToEnd(geneF5);
|
|
chromF.insertGeneToEnd(geneF6);
|
|
|
|
chroms.push_back(chromF);
|
|
} // (END) for(int i = 0; i < 2; i++)
|
|
|
|
fGenome.push_back(chroms.at(0));
|
|
mGenome.push_back(chroms.at(1));
|
|
Genotype* genotype = new Genotype(fGenome, mGenome);
|
|
// (END) Ãåíîì
|
|
|
|
// Ôåíîòèï
|
|
Trait trait1(Trait::Continious, "coadaptive", 0.0f);
|
|
Trait trait2(Trait::Continious, "disease", 0.0f);
|
|
Phenotype* phenotype = new Phenotype(trait1);
|
|
phenotype->addTrait(trait2);
|
|
// (END) Ôåíîòèï
|
|
|
|
// Ïóë ñóáñòðàòîâ
|
|
InnerSubstratesPool* subPool = 0;
|
|
// (END) Ïóë ñóáñòðàòîâ
|
|
|
|
Individual* newInd = new Individual(genotype, phenotype, subPool, Individual::hermaphrodite, 0);
|
|
newInd->setGenToPhenStrategy(GenotypeToPhenotypeStrategies::getInstance("inoutbreeding"));
|
|
individs.push_back(newInd);
|
|
} // (END) for(int i = 0; i < size; i++)
|
|
|
|
AsexualPopulation population(individs);
|
|
population.setBreedingStrategy(PopulationBreedingStrategy::getInstance("inoutbreeding"));
|
|
population.setRegion(®ion);
|
|
// (END) Ñîçäàíèå ïîïóëÿöèè
|
|
|
|
// Èòåðàöèîííûé öèêë
|
|
for(int i = 0; i < maxGenerations; i++){
|
|
// Ðàçìíîæèòü
|
|
population.breedAll();
|
|
//--- Ñòàòèñòèêà ---
|
|
stat = population.getSatistics();
|
|
statFile<<stat<<std::endl;
|
|
|
|
if(Settings::WRITE_FULL_STATISTICS_TO_FILE){
|
|
std::stringstream ss;
|
|
std::stringstream ss2;
|
|
ss<<"generation."<<(i)<<".xls";
|
|
ss2<<"generation."<<(i)<<".txt";
|
|
std::ofstream genFile(ss.str().c_str());
|
|
std::ofstream genFile2(ss2.str().c_str());
|
|
population.putGeneticStatisticsToStream(genFile);
|
|
population.putGeneticSimpleStatisticsToStream(genFile2);
|
|
genFile.close();
|
|
genFile2.close();
|
|
}
|
|
//------------------
|
|
}
|
|
statFile.close();
|
|
}
|
|
|
|
void Processor::fillVectors(const Genotype &g)
|
|
{
|
|
QVector<double> mGenes;
|
|
QVector<double> fGenes;
|
|
std::cout << "in fill" << std::endl;
|
|
for(unsigned int i = 0; i < g.fatherGenome.chromosomes.size(); i++)
|
|
{
|
|
|
|
std::cout <<"ch"<<(i+1)<<":";
|
|
const std::vector<Gene> genesF = g.fatherGenome.chromosomes.at(i).getGenesAsVector();
|
|
const std::vector<Gene> genesM = g.motherGenome.chromosomes.at(i).getGenesAsVector();
|
|
std::cout << "i11111" << std::endl;
|
|
Settings::geneName.clear();
|
|
for(unsigned int j = 0; j < genesF.size(); j++){
|
|
//std::cout<<"\t";
|
|
std::cout<<genesF.at(j).getName();//<<", ";
|
|
Settings::geneName.push_back(genesF.at(j).getName());
|
|
if(genesF.at(j).getGeneType() == Gene::Continious){
|
|
//std::cout<<"\t"<<genesF.at(j).getGeneValueCont() <<" " << genesM.at(j).getGeneValueCont() << std::endl;//<<"\t";
|
|
//std::cout<<"\t"<< genesM.at(j).getGeneValueCont() << std::endl;//<<"\t";
|
|
if (genesM.at(j).getGeneValueCont() < 0)
|
|
{
|
|
double val = genesM.at(j).getGeneValueCont() * (-1);
|
|
mGenes.push_back(val);
|
|
}
|
|
else
|
|
{
|
|
mGenes.push_back(genesM.at(j).getGeneValueCont());
|
|
}
|
|
|
|
if (genesF.at(j).getGeneValueCont() < 0)
|
|
{
|
|
double val = genesF.at(j).getGeneValueCont() * (-1);
|
|
fGenes.push_back(val);
|
|
}
|
|
else
|
|
{
|
|
fGenes.push_back(genesF.at(j).getGeneValueCont());
|
|
}
|
|
|
|
|
|
}
|
|
else{
|
|
//std::cout<<"\t"<<genesF.at(j).getGeneValueDiscr();//<<"\t";
|
|
//std::cout<<"\t"<<genesM.at(j).getGeneValueDiscr();//<<"\t";
|
|
mGenes.push_back(genesM.at(j).getGeneValueDiscr());
|
|
fGenes.push_back(genesF.at(j).getGeneValueDiscr());
|
|
}
|
|
//std::cout<<"\t";
|
|
}
|
|
}
|
|
Settings::malesGene.push_back(mGenes);
|
|
Settings::femalesGene.push_back(fGenes);
|
|
}
|
|
|
|
void Processor::fillVectors(Genotype *g)
|
|
{
|
|
QVector<double> mGenes;
|
|
QVector<double> fGenes;
|
|
for(unsigned int i = 0; i < g->fatherGenome.chromosomes.size(); i++)
|
|
{
|
|
|
|
//std::cout <<"ch"<<(i+1)<<":";
|
|
const std::vector<Gene> genesF = g->fatherGenome.chromosomes.at(i).getGenesAsVector();
|
|
const std::vector<Gene> genesM = g->motherGenome.chromosomes.at(i).getGenesAsVector();
|
|
Settings::geneName.clear();
|
|
for(unsigned int j = 0; j < genesF.size(); j++){
|
|
//std::cout<<"\t";
|
|
//std::cout<<genesF.at(j).getName();//<<", ";
|
|
Settings::geneName.push_back(genesF.at(j).getName());
|
|
if(genesF.at(j).getGeneType() == Gene::Continious){
|
|
//std::cout<<"\t"<<genesF.at(j).getGeneValueCont() <<" " << genesM.at(j).getGeneValueCont() << std::endl;//<<"\t";
|
|
//std::cout<<"\t"<< genesM.at(j).getGeneValueCont() << std::endl;//<<"\t";
|
|
if (genesM.at(j).getGeneValueCont() < 0)
|
|
{
|
|
double val = genesM.at(j).getGeneValueCont() * (-1);
|
|
mGenes.push_back(val);
|
|
}
|
|
else
|
|
{
|
|
mGenes.push_back(genesM.at(j).getGeneValueCont());
|
|
}
|
|
|
|
if (genesF.at(j).getGeneValueCont() < 0)
|
|
{
|
|
double val = genesF.at(j).getGeneValueCont() * (-1);
|
|
fGenes.push_back(val);
|
|
}
|
|
else
|
|
{
|
|
fGenes.push_back(genesF.at(j).getGeneValueCont());
|
|
}
|
|
|
|
|
|
}
|
|
else{
|
|
//std::cout<<"\t"<<genesF.at(j).getGeneValueDiscr();//<<"\t";
|
|
//std::cout<<"\t"<<genesM.at(j).getGeneValueDiscr();//<<"\t";
|
|
mGenes.push_back(genesM.at(j).getGeneValueDiscr());
|
|
fGenes.push_back(genesF.at(j).getGeneValueDiscr());
|
|
}
|
|
//std::cout<<"\t";
|
|
}
|
|
}
|
|
Settings::malesGene.push_back(mGenes);
|
|
Settings::femalesGene.push_back(fGenes);
|
|
}
|
|
|
|
void Processor::evolution(int generations)
|
|
{
|
|
for(int i = 0; i < generations; i++)
|
|
{
|
|
popul->breedAll();
|
|
}
|
|
//Settings::malesGene.clear();
|
|
//Settings::femalesGene.clear();
|
|
|
|
std::stringstream ss;
|
|
|
|
//ss<<"generation."<<(i)<<".xls";
|
|
|
|
std::ofstream genFile(ss.str().c_str());
|
|
|
|
popul->putGeneticStatisticsToStream(genFile);
|
|
// for(int i = 0; i < 10; i++)
|
|
// {
|
|
|
|
// std::cout << Processor::individs.at(i)->getGenotype() << std::endl;
|
|
// fillVectors(individs.at(i)->getGenotype());
|
|
// }
|
|
}
|
|
|
|
/////////////////////////////////////////////////////
|
|
void Processor::testInOutBreeding02(){
|
|
std::ofstream statFile("statFile.txt");
|
|
std::string stat;
|
|
|
|
// Èíèöèàëèçàöèÿ
|
|
int maxGenerations = Settings::Iterations;
|
|
long initPopSize = Settings::InitPopSize;
|
|
float ratioBetweenPops = Settings::InitRatioBetweenPops;
|
|
long int maxIndivids = Settings::KMaxParameter;
|
|
|
|
Position3D<double> position(0, 0, 0, 1000, 1000, 1000);
|
|
Region region(position, maxIndivids);
|
|
|
|
qsrand(0);
|
|
int RANGE = 1000;
|
|
int PRECISION = 10;
|
|
float gValue;
|
|
|
|
std::vector<Individual*> individs;
|
|
// Ñòîõàñòè÷åñêîå ñîçäàíèå ïîïóëÿöèè - ÷àñòü 1
|
|
for(int i = 0; i < initPopSize*ratioBetweenPops; i++){
|
|
// Ãåíîì
|
|
std::vector<Chromosome> fGenome;
|
|
std::vector<Chromosome> mGenome;
|
|
|
|
std::vector<Chromosome> chroms;
|
|
for(int j = 0; j < 2; j++){
|
|
// Îäíà õðîìîñîìà ñ øåñòüþ ãåíàìè
|
|
RANGE = 10;
|
|
gValue = (float)(rand()%(RANGE*PRECISION+1))/PRECISION;
|
|
Gene geneF1(Gene::Continious, "A coadaptive", gValue);
|
|
gValue = (float)(rand()%(RANGE*PRECISION+1))/PRECISION;
|
|
Gene geneF2(Gene::Continious, "B coadaptive", gValue);
|
|
|
|
RANGE = 2;
|
|
gValue = (rand()%(RANGE*PRECISION + 1)) / (float) RANGE / PRECISION;
|
|
Gene geneF3(Gene::Continious, "C disease", gValue);
|
|
gValue = (rand()%(RANGE*PRECISION + 1)) / (float) RANGE / PRECISION;
|
|
Gene geneF4(Gene::Continious, "D disease", gValue);
|
|
gValue = (rand()%(RANGE*PRECISION + 1)) / (float) RANGE / PRECISION;
|
|
Gene geneF5(Gene::Continious, "E disease", gValue);
|
|
gValue = (rand()%(RANGE*PRECISION + 1)) / (float) RANGE / PRECISION;
|
|
Gene geneF6(Gene::Continious, "F disease", gValue);
|
|
|
|
Chromosome chromF("Chrom 1"); // ïàïà / ìàìà
|
|
chromF.insertGeneToEnd(geneF1);
|
|
chromF.insertGeneToEnd(geneF2);
|
|
chromF.insertGeneToEnd(geneF3);
|
|
chromF.insertGeneToEnd(geneF4);
|
|
chromF.insertGeneToEnd(geneF5);
|
|
chromF.insertGeneToEnd(geneF6);
|
|
|
|
chroms.push_back(chromF);
|
|
} // (END) for(int i = 0; i < 2; i++)
|
|
|
|
fGenome.push_back(chroms.at(0));
|
|
mGenome.push_back(chroms.at(1));
|
|
Genotype* genotype = new Genotype(fGenome, mGenome);
|
|
// (END) Ãåíîì
|
|
|
|
// Ôåíîòèï
|
|
Trait trait1(Trait::Continious, "coadaptive", 0.0f);
|
|
Trait trait2(Trait::Continious, "disease", 0.0f);
|
|
Phenotype* phenotype = new Phenotype(trait1);
|
|
phenotype->addTrait(trait2);
|
|
// (END) Ôåíîòèï
|
|
|
|
Individual* newInd = new Individual(genotype, phenotype, 0, Individual::hermaphrodite, 0);
|
|
newInd->setGenToPhenStrategy(GenotypeToPhenotypeStrategies::getInstance("inoutbreeding"));
|
|
individs.push_back(newInd);
|
|
} // (END) for(int i = 0; i < size; i++)
|
|
|
|
// Ñòîõàñòè÷åñêîå ñîçäàíèå ïîïóëÿöèè - ÷àñòü 2
|
|
for(int i = 0; i < initPopSize; i++){
|
|
//std::cout << i << std::endl;
|
|
// Ãåíîì
|
|
std::vector<Chromosome> fGenome;
|
|
std::vector<Chromosome> mGenome;
|
|
|
|
std::vector<Chromosome> chroms;
|
|
for(int j = 0; j < 2; j++){
|
|
// Îäíà õðîìîñîìà ñ øåñòüþ ãåíàìè
|
|
RANGE = 10;
|
|
gValue = -(float)(rand()%(RANGE*PRECISION+1))/PRECISION;
|
|
Gene geneF1(Gene::Continious, "A coadaptive", gValue);
|
|
gValue = -(float)(rand()%(RANGE*PRECISION+1))/PRECISION;
|
|
Gene geneF2(Gene::Continious, "B coadaptive", gValue);
|
|
|
|
PRECISION=1;
|
|
RANGE = 2;
|
|
gValue = (rand()%(RANGE*PRECISION + 1)) / (float) RANGE / PRECISION;
|
|
Gene geneF3(Gene::Continious, "C disease", gValue);
|
|
gValue = (rand()%(RANGE*PRECISION + 1)) / (float) RANGE / PRECISION;
|
|
Gene geneF4(Gene::Continious, "D disease", gValue);
|
|
gValue = (rand()%(RANGE*PRECISION + 1)) / (float) RANGE / PRECISION;
|
|
Gene geneF5(Gene::Continious, "E disease", gValue);
|
|
gValue = (rand()%(RANGE*PRECISION + 1)) / (float) RANGE / PRECISION;
|
|
Gene geneF6(Gene::Continious, "F disease", gValue);
|
|
|
|
Chromosome chromF("Chrom 1"); // ïàïà / ìàìà
|
|
chromF.insertGeneToEnd(geneF1);
|
|
chromF.insertGeneToEnd(geneF2);
|
|
chromF.insertGeneToEnd(geneF3);
|
|
chromF.insertGeneToEnd(geneF4);
|
|
chromF.insertGeneToEnd(geneF5);
|
|
chromF.insertGeneToEnd(geneF6);
|
|
|
|
chroms.push_back(chromF);
|
|
} // (END) for(int i = 0; i < 2; i++)
|
|
|
|
fGenome.push_back(chroms.at(0));
|
|
mGenome.push_back(chroms.at(1));
|
|
Genotype* genotype = new Genotype(fGenome, mGenome);
|
|
// (END) Ãåíîì
|
|
|
|
fillVectors(genotype);
|
|
// Ôåíîòèï
|
|
Trait trait1(Trait::Continious, "coadaptive", 0.0f);
|
|
Trait trait2(Trait::Continious, "disease", 0.0f);
|
|
Phenotype* phenotype = new Phenotype(trait1);
|
|
phenotype->addTrait(trait2);
|
|
// (END) Ôåíîòèï
|
|
|
|
Individual* newInd = new Individual(genotype, phenotype, 0, Individual::hermaphrodite, 0);
|
|
newInd->setGenToPhenStrategy(GenotypeToPhenotypeStrategies::getInstance("inoutbreeding"));
|
|
individs.push_back(newInd);
|
|
} // (END) for(int i = 0; i < size; i++)
|
|
|
|
//popul = new AsexualPopulation(Processor::individs);
|
|
AsexualPopulation population(individs);
|
|
population.setBreedingStrategy(PopulationBreedingStrategy::getInstance("inoutbreeding"));
|
|
population.setRegion(®ion);
|
|
// (END) Ñîçäàíèå ïîïóëÿöèè
|
|
|
|
// Èòåðàöèîííûé öèêë
|
|
for(int i = 0; i < maxGenerations; i++){
|
|
// Ðàçìíîæèòü
|
|
population.breedAll();
|
|
// std::stringstream ss;
|
|
// std::ofstream genFile(ss.str().c_str());
|
|
// population.putGeneticStatisticsToStream(genFile);
|
|
//--- Ñòàòèñòèêà ---
|
|
stat = population.getSatistics();
|
|
statFile<<stat<<std::endl;
|
|
|
|
if(Settings::WRITE_FULL_STATISTICS_TO_FILE){
|
|
std::stringstream ss;
|
|
std::stringstream ss2;
|
|
std::stringstream ss3;
|
|
ss<<"generation."<<(i)<<".xls";
|
|
ss2<<"generation."<<(i)<<".txt";
|
|
ss3<<"gmaxAB."<<(i)<<".txt";
|
|
std::ofstream genFile(ss.str().c_str());
|
|
std::ofstream genFile2(ss2.str().c_str());
|
|
std::ofstream genFile3(ss3.str().c_str());
|
|
population.putGeneticStatisticsToStream(genFile);
|
|
population.putGeneticSimpleStatisticsToStream(genFile2);
|
|
population.putGeneticMaxModuleStatisticsToStream(genFile3);
|
|
genFile.close();
|
|
genFile2.close();
|
|
genFile3.close();
|
|
}
|
|
//------------------
|
|
|
|
}
|
|
statFile.close();
|
|
//Settings::malesGene.clear();
|
|
//Settings::femalesGene.clear();
|
|
//std::stringstream ss;
|
|
|
|
//ss<<"generation."<<(i)<<".xls";
|
|
|
|
//std::ofstream genFile(ss.str().c_str());
|
|
|
|
//population.putGeneticStatisticsToStream(genFile);
|
|
// for(int i = 0; i < individs.size(); i++)
|
|
// {
|
|
// std::cout <<"iterate" << i << std::endl;
|
|
// //fillVectors(individs.at(i)->getGenotype());
|
|
// std::cout <<"iterate after " << i << std::endl;
|
|
// }
|
|
|
|
}
|