Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

CPopulation.cpp 16.5 KB
Newer Older
kruger's avatar
kruger committed
1
2
3
4
5
6
7
8
/*
 * CPopulation.cpp
 *
 *  Created on: 22 juin 2009
 *      Author: maitre
 */

#include "include/CPopulation.h"
kruger's avatar
kruger committed
9
10
#include <iostream>
#include <fstream>
kruger's avatar
kruger committed
11
#include <string.h>
Joseph Pallamidessi's avatar
Joseph Pallamidessi committed
12
13
14
#ifdef _OPENMP
#include <omp.h>
#endif
kruger's avatar
kruger committed
15
16
17
#include "include/CRandomGenerator.h"
#include "include/CIndividual.h"
#include "include/Parameters.h"
18
#include "include/CStats.h"
kruger's avatar
kruger committed
19

kruger's avatar
kruger committed
20
21
using namespace std;

kruger's avatar
kruger committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
CSelectionOperator* CPopulation::selectionOperator;
CSelectionOperator* CPopulation::replacementOperator;
CSelectionOperator* CPopulation::parentReductionOperator;
CSelectionOperator* CPopulation::offspringReductionOperator;


float CPopulation::selectionPressure;
float CPopulation::replacementPressure;
float CPopulation::parentReductionPressure;
float CPopulation::offspringReductionPressure;


extern float* pEZ_MUT_PROB;
extern float* pEZ_XOVER_PROB;
extern CIndividual** pPopulation;
maitre's avatar
maitre committed
37
extern CIndividual* bBest;
kruger's avatar
kruger committed
38
39
40
41

CPopulation::CPopulation(){
}

Ogier Maitre's avatar
Ogier Maitre committed
42
CPopulation::CPopulation(unsigned parentPopulationSize, unsigned offspringPopulationSize,
43
44
           float pCrossover, float pMutation, float pMutationPerGene,
           CRandomGenerator* rg, Parameters* params, CStats* cstats){
kruger's avatar
kruger committed
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

  this->parents     = new CIndividual*[parentPopulationSize];
  this->offsprings  = new CIndividual*[offspringPopulationSize];

  this->parentPopulationSize     = parentPopulationSize;
  this->offspringPopulationSize  = offspringPopulationSize;

  this->actualParentPopulationSize    = 0;
  this->actualOffspringPopulationSize = 0;

  this->pCrossover       = pCrossover;
  this->pMutation        = pMutation;
  pEZ_MUT_PROB = &this->pMutation;
  pEZ_XOVER_PROB = &this->pCrossover;
  this->pMutationPerGene = pMutationPerGene;
  pPopulation = parents;
maitre's avatar
maitre committed
61
  bBest = Best;
kruger's avatar
kruger committed
62
63
64
65
66

  this->rg = rg;

  this->currentEvaluationNb = 0;
  this->params = params;
67
  this->cstats = cstats;
kruger's avatar
kruger committed
68
69
70
}

void CPopulation::syncInVector(){
Ogier Maitre's avatar
Ogier Maitre committed
71
  for( unsigned i = 0 ; i<actualParentPopulationSize ; i++ ){
kruger's avatar
kruger committed
72
73
74
75
76
77
    parents[i] = pop_vect.at(i);
  }
}

void CPopulation::syncOutVector(){
  pop_vect.clear();
Ogier Maitre's avatar
Ogier Maitre committed
78
  for( unsigned i = 0 ; i<actualParentPopulationSize ; i++ ){
kruger's avatar
kruger committed
79
80
81
82
83
84
85
86
    pop_vect.push_back(parents[i]);
  }
#ifndef WIN32
  DEBUG_PRT("Size of outVector",pop_vect.size());
#endif
}

CPopulation::~CPopulation(){
Ogier Maitre's avatar
Ogier Maitre committed
87
88
  for( unsigned i=0 ; i<actualOffspringPopulationSize ; i++ ) delete(offsprings[i]);
  for( unsigned i=0 ; i<actualParentPopulationSize ; i++ )    delete(parents[i]);
kruger's avatar
kruger committed
89
90
91
92
93
94

  delete[](this->parents);
  delete[](this->offsprings);
}

void CPopulation::initPopulation(CSelectionOperator* selectionOperator,
95
96
97
98
99
        CSelectionOperator* replacementOperator,
        CSelectionOperator* parentReductionOperator,
        CSelectionOperator* offspringReductionOperator,
        float selectionPressure, float replacementPressure,
        float parentReductionPressure, float offspringReductionPressure){
kruger's avatar
kruger committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
  CPopulation::selectionOperator   = selectionOperator;
  CPopulation::replacementOperator = replacementOperator;
  CPopulation::parentReductionOperator = parentReductionOperator;
  CPopulation::offspringReductionOperator = offspringReductionOperator;

  CPopulation::selectionPressure   = selectionPressure;
  CPopulation::replacementPressure = replacementPressure;
  CPopulation::parentReductionPressure = parentReductionPressure;
  CPopulation::offspringReductionPressure = offspringReductionPressure;

}




Ogier Maitre's avatar
Ogier Maitre committed
115
void CPopulation::evaluatePopulation(CIndividual** population, unsigned populationSize){
Joseph Pallamidessi's avatar
Joseph Pallamidessi committed
116
  #pragma omp parallel for schedule(runtime)
Ogier Maitre's avatar
Ogier Maitre committed
117
  for( unsigned i=0 ; i < populationSize ; i++ )
kruger's avatar
kruger committed
118
119
120
    population[i]->evaluate();
}

Ogier Maitre's avatar
Ogier Maitre committed
121
void CPopulation::optimisePopulation(CIndividual** population, unsigned populationSize){
kruger's avatar
kruger committed
122
}
kruger's avatar
kruger committed
123
124
125
126
127

void CPopulation::evaluateParentPopulation(){
  evaluatePopulation(parents,parentPopulationSize);
}

kruger's avatar
kruger committed
128
129
130
void CPopulation::optimiseParentPopulation(){
  optimisePopulation(parents,parentPopulationSize);
}
kruger's avatar
kruger committed
131
132
133

void CPopulation::evaluateOffspringPopulation(){
  evaluatePopulation(offsprings,offspringPopulationSize);
kruger's avatar
kruger committed
134
135
136
137
}

void CPopulation::optimiseOffspringPopulation(){
  optimisePopulation(offsprings,offspringPopulationSize);
kruger's avatar
kruger committed
138
139
140
141
142
143
144
145
146
147
148
149
}


/**
   Reduit la population population de taille populationSize
   a une population reducedPopulation de taille obSize.
   reducedPopulation doit etre alloue a obSize.

   Ici on pourrait avoir le best fitness de la prochaine population de parents.


 */
Ogier Maitre's avatar
Ogier Maitre committed
150
void CPopulation::reducePopulation(CIndividual** population, unsigned populationSize,
151
152
            CIndividual** reducedPopulation, unsigned obSize,
            CSelectionOperator* replacementOperator,int pressure){
kruger's avatar
kruger committed
153
154


155
  replacementOperator->initialize(population,pressure,populationSize);
kruger's avatar
kruger committed
156

Ogier Maitre's avatar
Ogier Maitre committed
157
  for( unsigned i=0 ; i<obSize ; i++ ){
kruger's avatar
kruger committed
158
159

    // select an CIndividual and add it to the reduced population
Ogier Maitre's avatar
Ogier Maitre committed
160
    unsigned selectedIndex = replacementOperator->selectNext(populationSize - i);
kruger's avatar
kruger committed
161
    // std::cout << "Selected " << selectedIndex << "/" << populationSize
162
    //        << " replaced by : " << populationSize-(i+1)<< std::endl;
kruger's avatar
kruger committed
163
    reducedPopulation[i] = population[selectedIndex];
maitre's avatar
maitre committed
164
    //printf("TEST REMPLACEMENT %d %d %f %f\n", i, selectedIndex, reducedPopulation[i]->fitness, population[selectedIndex]->fitness);
kruger's avatar
kruger committed
165
166
167
168
169
170
171
172
173
174

    // erase it to the std population by swapping last CIndividual end current
    population[selectedIndex] = population[populationSize-(i+1)];
    //population[populationSize-(i+1)] = NULL;
  }

  //return reducedPopulation;
}


Ogier Maitre's avatar
Ogier Maitre committed
175
CIndividual** CPopulation::reduceParentPopulation(unsigned obSize){
maitre's avatar
maitre committed
176
177
  CIndividual** nextGeneration;
  if(obSize==0){
178
    nextGeneration = new CIndividual*[1];
maitre's avatar
maitre committed
179
180
  }
  else
181
    nextGeneration = new CIndividual*[obSize];
kruger's avatar
kruger committed
182
183

  reducePopulation(parents,actualParentPopulationSize,nextGeneration,obSize,
184
       CPopulation::parentReductionOperator,parentReductionPressure);
kruger's avatar
kruger committed
185
186

  // free no longer needed CIndividuals
Ogier Maitre's avatar
Ogier Maitre committed
187
  for( unsigned i=0 ; i<actualParentPopulationSize-obSize ; i++ )
kruger's avatar
kruger committed
188
189
190
191
192
    delete(parents[i]);
  delete[](parents);

  this->actualParentPopulationSize = obSize;

maitre's avatar
maitre committed
193
  parents = nextGeneration;
kruger's avatar
kruger committed
194
195
196
197
198
199

  return nextGeneration;
}



Ogier Maitre's avatar
Ogier Maitre committed
200
CIndividual** CPopulation::reduceOffspringPopulation(unsigned obSize){
kruger's avatar
kruger committed
201
202
203
204
205
  // this array has offspringPopulationSize because it will be used as offspring population in
  // the next generation
  CIndividual** nextGeneration = new CIndividual*[offspringPopulationSize];

  reducePopulation(offsprings,actualOffspringPopulationSize,nextGeneration,obSize,
206
       CPopulation::offspringReductionOperator,offspringReductionPressure);
kruger's avatar
kruger committed
207

maitre's avatar
maitre committed
208
  //printf("POPULATION SIZE %d\n",actualOffspringPopulationSize-obSize);
kruger's avatar
kruger committed
209
  // free no longer needed CIndividuals
Ogier Maitre's avatar
Ogier Maitre committed
210
  for( unsigned i=0 ; i<actualOffspringPopulationSize-obSize ; i++ )
kruger's avatar
kruger committed
211
212
    delete(offsprings[i]);
  delete[](offsprings);
maitre's avatar
maitre committed
213
214
  //printf("DANS LA FONCTION DE REMPLACEMENT\n");
  /*for(int i=0; i<parentPopulationSize; i++)
215
  printf("Indiv %d %f | ",i, parents[i]->fitness);
maitre's avatar
maitre committed
216
  printf("\n");*/
kruger's avatar
kruger committed
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238

  this->actualOffspringPopulationSize = obSize;
  offsprings = nextGeneration;
  return nextGeneration;
}


static int CIndividualCompare(const void* p1, const void* p2){
  CIndividual** p1_i = (CIndividual**)p1;
  CIndividual** p2_i = (CIndividual**)p2;

  return p1_i[0]->getFitness() > p2_i[0]->getFitness();
}

static int CIndividualRCompare(const void* p1, const void* p2){
  CIndividual** p1_i = (CIndividual**)p1;
  CIndividual** p2_i = (CIndividual**)p2;

  return p1_i[0]->getFitness() < p2_i[0]->getFitness();
}


Ogier Maitre's avatar
Ogier Maitre committed
239
void CPopulation::sortPopulation(CIndividual** population, unsigned populationSize){
kruger's avatar
kruger committed
240
241
242
  qsort(population,populationSize,sizeof(CIndividual*),CIndividualCompare);
}

Ogier Maitre's avatar
Ogier Maitre committed
243
void CPopulation::sortRPopulation(CIndividual** population, unsigned populationSize){
kruger's avatar
kruger committed
244
245
246
  qsort(population,populationSize,sizeof(CIndividual*),CIndividualRCompare);
}

kruger's avatar
kruger committed
247
248
249
250
251
252
253
/* Fonction qui va serializer la population */
void CPopulation::serializePopulation(){
  ofstream EASEA_File;
  std::string fichier = params->outputFilename;
  fichier.append(".pop");
  EASEA_File.open(fichier.c_str(), ios::app); 
  for(int i=0; (unsigned)i<parentPopulationSize; i++){
254
255
  EASEA_File << parents[i]->serialize() << endl;
  
kruger's avatar
kruger committed
256
257
258
259
  }
  EASEA_File.close();
}

260
int CPopulation::getWorstIndividualIndex(CIndividual** population){
261
262
263
264
265
266
  int index=0;
  for(int i=1; i<(signed)this->parentPopulationSize; i++){
    if((params->minimizing && (population[i]->fitness > population[index]->fitness)) || (!params->minimizing && (population[i]->fitness < population[index]->fitness)))
      index=i;
  } 
  return index;
267
268
}

kruger's avatar
kruger committed
269
270
271
272
273
274
275
276

/**
   Reduit les populations en faisant l'operation de remplacement.

   @TODO : on aurait voulu eviter la recopie des deux populations en une seule
   mais cela semble incompatible avec CSelectionOperator (notamment l'operation
   d'initialisation.
*/
maitre's avatar
maitre committed
277
void CPopulation::reduceTotalPopulation(CIndividual** elitPop){
kruger's avatar
kruger committed
278
279
280

  CIndividual** nextGeneration = new CIndividual*[parentPopulationSize];

maitre's avatar
maitre committed
281
  if(params->elitSize)
282
  memcpy(nextGeneration,elitPop, sizeof(CIndividual*)*params->elitSize);
kruger's avatar
kruger committed
283

Ogier Maitre's avatar
Ogier Maitre committed
284
  unsigned actualGlobalSize = actualParentPopulationSize+actualOffspringPopulationSize;
maitre's avatar
maitre committed
285
  
kruger's avatar
kruger committed
286
287
  CIndividual** globalPopulation = new CIndividual*[actualGlobalSize]();

maitre's avatar
maitre committed
288
  if(actualParentPopulationSize==0){
289
    memcpy(globalPopulation,offsprings,sizeof(CIndividual*)*actualOffspringPopulationSize);
maitre's avatar
maitre committed
290
291
  }
  else if(actualOffspringPopulationSize==0){
292
    memcpy(globalPopulation,parents,sizeof(CIndividual*)*actualParentPopulationSize);
maitre's avatar
maitre committed
293
294
  }
  else{
295
    memcpy(globalPopulation,parents,sizeof(CIndividual*)*actualParentPopulationSize);
maitre's avatar
maitre committed
296
        memcpy(globalPopulation+actualParentPopulationSize,offsprings,sizeof(CIndividual*)*actualOffspringPopulationSize);
kruger's avatar
kruger committed
297
298
299
  }


maitre's avatar
maitre committed
300
301
  replacementOperator->initialize(globalPopulation, replacementPressure,actualGlobalSize);

kruger's avatar
kruger committed
302
  CPopulation::reducePopulation(globalPopulation,actualGlobalSize,params->elitSize+nextGeneration,
303
             parentPopulationSize-params->elitSize,replacementOperator,replacementPressure);
kruger's avatar
kruger committed
304

maitre's avatar
maitre committed
305

kruger's avatar
kruger committed
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
  for( unsigned int i=0 ; i<((int)actualGlobalSize+params->elitSize)-(int)parentPopulationSize ; i++ )
    delete(globalPopulation[i]);

  delete[](parents);
  delete[](globalPopulation);

  actualParentPopulationSize = parentPopulationSize;
  actualOffspringPopulationSize = 0;
  parents = nextGeneration;

}


void CPopulation::produceOffspringPopulation(){

Ogier Maitre's avatar
Ogier Maitre committed
321
  unsigned crossoverArrity = CIndividual::getCrossoverArrity();
kruger's avatar
kruger committed
322
323
324
325
326
327
  CIndividual* p1;
  CIndividual** ps = new CIndividual*[crossoverArrity]();
  CIndividual* child;

  selectionOperator->initialize(parents,selectionPressure,actualParentPopulationSize);

Ogier Maitre's avatar
Ogier Maitre committed
328
329
  for( unsigned i=0 ; i<offspringPopulationSize ; i++ ){
    unsigned index = selectionOperator->selectNext(parentPopulationSize);
kruger's avatar
kruger committed
330
331
    p1 = parents[index];

332
333
334
335
336
    //Check if Any Immigrants will reproduce
    if( this->params->remoteIslandModel && parents[index]->isImmigrant ){
        this->cstats->currentNumberOfImmigrantReproductions++;
    }

kruger's avatar
kruger committed
337
    if( rg->tossCoin(pCrossover) ){
Ogier Maitre's avatar
Ogier Maitre committed
338
      for( unsigned j=0 ; j<crossoverArrity-1 ; j++ ){
339
340
      index = selectionOperator->selectNext(parentPopulationSize);
      ps[j] = parents[index];
341
342
343
        if( this->params->remoteIslandModel && parents[index]->isImmigrant ){
            this->cstats->currentNumberOfImmigrantReproductions++;
        }
kruger's avatar
kruger committed
344
345
346
347
348
349
350
351
352
      }
      child = p1->crossover(ps);
    }
    else child = parents[index]->clone();//new CIndividual(*parents[index]);

    if( rg->tossCoin(pMutation) ){
      child->mutate(pMutationPerGene);
    }

Frederic Kruger's avatar
Frederic Kruger committed
353
354
    child->boundChecking();

kruger's avatar
kruger committed
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
    offsprings[actualOffspringPopulationSize++] = child;
  }
  delete[](ps);
  }




/**
   Here we save elit CIndividuals to the replacement

   @ARG elitismSize the number of CIndividuals save by elitism
   @ARG population the population where the CIndividuals are save
   @ARG populationSize the size of the population
   @ARG outPopulation the output population, this must be allocated with size greather than elitism
   @ARG outPopulationSize the size of the output population

*/
Ogier Maitre's avatar
Ogier Maitre committed
373
void CPopulation::strongElitism(unsigned elitismSize, CIndividual** population, unsigned populationSize,
374
       CIndividual** outPopulation, unsigned outPopulationSize){
kruger's avatar
kruger committed
375
376

  float bestFitness = population[0]->getFitness();
Ogier Maitre's avatar
Ogier Maitre committed
377
  unsigned bestCIndividual = 0;
kruger's avatar
kruger committed
378
379
380
381
382

#ifndef WIN32
  if( elitismSize >= 5 )DEBUG_PRT("Warning, elitism has O(n) complexity, elitismSize is maybe too big (%d)",elitismSize);
#endif

maitre's avatar
maitre committed
383
  //printf("MINIMIZING ? %d\n",params->minimizing);
Ogier Maitre's avatar
Ogier Maitre committed
384
  for(unsigned i = 0 ; i<elitismSize ; i++ ){
maitre's avatar
maitre committed
385
386
    //bestFitness = replacementOperator->getExtremum();
    bestFitness = population[0]->getFitness();
kruger's avatar
kruger committed
387
    bestCIndividual = 0;
Ogier Maitre's avatar
Ogier Maitre committed
388
    for( unsigned j=0 ; j<populationSize-i ; j++ ){
kruger's avatar
kruger committed
389

390
391
392
393
394
      if( (params->minimizing && bestFitness > population[j]->getFitness() ) ||
          ( !params->minimizing && bestFitness < population[j]->getFitness() )){
        bestFitness = population[j]->getFitness();
        bestCIndividual = j;
      }
kruger's avatar
kruger committed
395
396
397
398
399
400
401
    }
    outPopulation[i] = population[bestCIndividual];
    population[bestCIndividual] = population[populationSize-(i+1)];
    population[populationSize-(i+1)] = NULL;
  }
}

Ogier Maitre's avatar
Ogier Maitre committed
402
void CPopulation::weakElitism(unsigned elitismSize, CIndividual** parentsPopulation, CIndividual** offspringPopulation, unsigned* parentPopSize, unsigned* offPopSize, CIndividual** outPopulation, unsigned outPopulationSize){
maitre's avatar
maitre committed
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425

  float bestParentFitness = parentsPopulation[0]->getFitness();
  float bestOffspringFitness = offspringPopulation[0]->getFitness();
  int bestParentIndiv = 0;
  int bestOffspringIndiv = 0;

  for(int i=1; (unsigned)i<(*parentPopSize); i++){
        if( (params->minimizing && bestParentFitness > parentsPopulation[i]->getFitness() ) ||
                        ( !params->minimizing && bestParentFitness < parentsPopulation[i]->getFitness() )){
                bestParentFitness = parentsPopulation[i]->getFitness();
                bestParentIndiv = i;
        }
  }
 
  for(int i=1; (unsigned)i<(*offPopSize); i++){
        if( (params->minimizing && bestOffspringFitness > offspringPopulation[i]->getFitness() ) ||
                        ( !params->minimizing && bestOffspringFitness < offspringPopulation[i]->getFitness() )){
                bestOffspringFitness = offspringPopulation[i]->getFitness();
                bestOffspringIndiv = i;
        }
  }
 
  for(int i = 0 ; (unsigned)i<elitismSize ; i++ ){
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
  if(((!params->minimizing && bestParentFitness > bestOffspringFitness) || (params->minimizing && bestParentFitness<bestOffspringFitness) || (*offPopSize)==0) && (*parentPopSize)>0){
    outPopulation[i] = parentsPopulation[bestParentIndiv];
    parentsPopulation[bestParentIndiv] = parentsPopulation[(*parentPopSize)-1];
    parentsPopulation[(*parentPopSize)-1] = NULL;
    (*parentPopSize)-=1; 
    if((*parentPopSize)>0){
        bestParentFitness = parentsPopulation[0]->getFitness();
      bestParentIndiv=0;
      for(int j=1; (unsigned)j<(*parentPopSize); j++){
              if( (params->minimizing && bestParentFitness > parentsPopulation[j]->getFitness() ) ||
                            ( !params->minimizing && bestParentFitness < parentsPopulation[j]->getFitness() )){
                      bestParentFitness = parentsPopulation[j]->getFitness();
                      bestParentIndiv = j;
              }
        }
    }
  }
  else{
    outPopulation[i] = offspringPopulation[bestOffspringIndiv];
    offspringPopulation[bestOffspringIndiv] = offspringPopulation[(*offPopSize)-1];
    offspringPopulation[(*offPopSize)-1] = NULL;
    (*offPopSize)-=1;
    if((*offPopSize)>0){
        bestOffspringFitness = offspringPopulation[0]->getFitness();
      bestOffspringIndiv = 0; 
      for(int j=1; (unsigned)j<(*offPopSize); j++){
              if( (params->minimizing && bestOffspringFitness > offspringPopulation[j]->getFitness() ) ||
                            ( !params->minimizing && bestOffspringFitness < offspringPopulation[j]->getFitness() )){
                      bestOffspringFitness = offspringPopulation[j]->getFitness();
                      bestOffspringIndiv = j;
              }
        }
    } 
  }
maitre's avatar
maitre committed
460
461
  }
}
kruger's avatar
kruger committed
462
463


Ogier Maitre's avatar
Ogier Maitre committed
464
void CPopulation::addIndividualParentPopulation(CIndividual* indiv, unsigned id){
465
  parents[id] = indiv;
kruger's avatar
kruger committed
466
}
467
void CPopulation::addIndividualParentPopulation(CIndividual* indiv){
468
  parents[actualParentPopulationSize++] = indiv;
469
}
kruger's avatar
kruger committed
470
471
472
473

std::ostream& operator << (std::ostream& O, const CPopulation& B)
{

Ogier Maitre's avatar
Ogier Maitre committed
474
475
  unsigned offspringPopulationSize = B.offspringPopulationSize;
  unsigned realOffspringPopulationSize = B.actualOffspringPopulationSize;
kruger's avatar
kruger committed
476

Ogier Maitre's avatar
Ogier Maitre committed
477
478
  unsigned parentPopulationSize = B.parentPopulationSize;
  unsigned realParentPopulationSize = B.actualParentPopulationSize;
kruger's avatar
kruger committed
479
480
481
482
483
484
485
486


  O << "CPopulation : "<< std::endl;
  O << "\t Parents size : "<< realParentPopulationSize << "/" <<
    parentPopulationSize << std::endl;

  O << "\t Offspring size : "<< realOffspringPopulationSize << "/" <<
    offspringPopulationSize << std::endl;
Ogier Maitre's avatar
Ogier Maitre committed
487
  for( unsigned i=0 ; i<realParentPopulationSize ; i++){
488
489
  B.parents[i]->printOn(O);
   O << "\n";
kruger's avatar
kruger committed
490
491
492
493
494

  }
  return O;
}