Commit 541b0b9d authored by Joseph Pallamidessi's avatar Joseph Pallamidessi

Clean a bit the directories and the compiler have its own

parent 2c92732c
...@@ -28,12 +28,12 @@ FILE(GLOB boost_src boost/*.cpp) ...@@ -28,12 +28,12 @@ FILE(GLOB boost_src boost/*.cpp)
ADD_LIBRARY( program_options STATIC ${boost_src} ) ADD_LIBRARY( program_options STATIC ${boost_src} )
SET_TARGET_PROPERTIES(program_options PROPERTIES OUTPUT_NAME "program_options" PREFIX "" COMPILE_FLAGS "-O2") SET_TARGET_PROPERTIES(program_options PROPERTIES OUTPUT_NAME "program_options" PREFIX "" COMPILE_FLAGS "-O2")
#Easea compiler
SET(easea_src SET(easea_src
EaseaLex.cpp compiler/EaseaLex.cpp
EaseaParse.cpp compiler/EaseaParse.cpp
EaseaSym.cpp compiler/EaseaSym.cpp
EaseaYTools.cpp) compiler/EaseaYTools.cpp)
ADD_EXECUTABLE(easea ${easea_src}) ADD_EXECUTABLE(easea ${easea_src})
......
...@@ -29,27 +29,27 @@ else ...@@ -29,27 +29,27 @@ else
# You can now install easea into your system or use it from # You can now install easea into your system or use it from
# its current directory. # its current directory.
# #
# System Installation (you need admnistration rights): # Installation:
# To install EASEA into your system, type:
# ". install.sh ".
# EASEA will be installed into /usr/local/easea/ directory, # EASEA will be installed into /usr/local/easea/ directory,
# including, the binary, its libraries and the templates. # including, the binary, its libraries and the templates.
# Finally, environment variables will be updated (EZ_PATH and PATH), # Finaly, environment variables will be updated (EZ_PATH and PATH),
ifeq ($(UNAME),Darwin) ifeq ($(UNAME),Darwin)
# into your .bash_profile file. # into your .bash_profile file.
else else
# into your .bashrc file. # into your .bashrc file.
endif endif
# To install EASEA into your system, type:
# "source install.sh "
# #
# Local Usage: # Local Usage:
# All EASEA elements will stay in the current directory, # All EASEA elements will stay in the current directory,
# but some environment variables need to be updated into your # but some environment variables need to be updated into your
ifeq ($(UNAME),Darwin) ifeq ($(UNAME),Darwin)
# .bash_profile file (EZ_PATH). To do so type: # .bash_profile file (EZ_PATH and). To do so type:
else else
# .bashrc file (EZ_PATH). To do so type: # .bashrc file (EZ_PATH and). To do so type:
endif endif
# "source install.sh local" # ". install.sh local".
# #
# Thanks for using EASEA. # Thanks for using EASEA.
# #
...@@ -80,13 +80,13 @@ bin: ...@@ -80,13 +80,13 @@ bin:
@test -d bin || mkdir bin || echo "Cannot make dir bin" @test -d bin || mkdir bin || echo "Cannot make dir bin"
build/EaseaParse.o: EaseaParse.cpp EaseaLex.cpp build/EaseaParse.o: compiler/EaseaParse.cpp compiler/EaseaLex.cpp
$(CXX) $(CPPFLAGS) $< -o $@ -c -w $(CXX) $(CPPFLAGS) $< -o $@ -c -w
build/EaseaLex.o: EaseaLex.cpp build/EaseaLex.o: compiler/EaseaLex.cpp
$(CXX) $(CPPFLAGS) $< -o $@ -c -w $(CXX) $(CPPFLAGS) $< -o $@ -c -w
build/%.o:%.cpp build/%.o:compiler/%.cpp
$(CXX) $(CPPFLAGS) -c -o $@ $< $(CXX) $(CPPFLAGS) -c -o $@ $<
#compile library for alex and ayacc unix version #compile library for alex and ayacc unix version
......
...@@ -81,8 +81,10 @@ bin: ...@@ -81,8 +81,10 @@ bin:
build/EaseaParse.o: EaseaParse.cpp EaseaLex.cpp build/EaseaParse.o: EaseaParse.cpp EaseaLex.cpp
cd compiler
$(CXX) $(CPPFLAGS) $< -o $@ -c -w $(CXX) $(CPPFLAGS) $< -o $@ -c -w
build/EaseaLex.o: EaseaLex.cpp build/EaseaLex.o: EaseaLex.cpp
cd compiler
$(CXX) $(CPPFLAGS) $< -o $@ -c -w $(CXX) $(CPPFLAGS) $< -o $@ -c -w
......
...@@ -2423,7 +2423,7 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable) ...@@ -2423,7 +2423,7 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable)
if (bVERBOSE) { if (bVERBOSE) {
printf("\n "); printf("\n ");
printf("\n E A S E A (v1.1)"); printf("\n E A S E A (v1.0.3)");
printf("\n ___________________ "); printf("\n ___________________ ");
printf("\n "); printf("\n ");
printf("\n Stochastic Optimisation and Nature Inspired Computing"); printf("\n Stochastic Optimisation and Nature Inspired Computing");
......
...@@ -8,9 +8,16 @@ ...@@ -8,9 +8,16 @@
#ifndef CCMAES_H_ #ifndef CCMAES_H_
#define CCMAES_H_ #define CCMAES_H_
#include "define.h" #include "define.h"
/**
* \class Caleatoire
* \brief Random generator for CMA-ES
* \details Randomness using Gaussian or Uniform distribution
*
**/
class Caleatoire class Caleatoire
{ {
public: public:
/* Variables for Uniform() */ /* Variables for Uniform() */
long int startseed; long int startseed;
long int aktseed; long int aktseed;
...@@ -20,16 +27,22 @@ public: ...@@ -20,16 +27,22 @@ public:
/* Variables for Gauss() */ /* Variables for Gauss() */
short flgstored; short flgstored;
double hold; double hold;
public: public:
long alea_Start(long unsigned inseed); long alea_Start(long unsigned inseed);
long alea_init(long unsigned inseed); long alea_init(long unsigned inseed);
double alea_Gauss(); double alea_Gauss();
double alea_Uniform(); double alea_Uniform();
}; };
/**
* \class CCmaes
* \brief Covariance Matrix Adaptation Evolution Strategy
* \details Is set before entering the main evolutionary loop
*
**/
class CCmaes{ class CCmaes{
//random_t rand; /* random number generator */ //random_t rand; /* random number generator */
public: public:
int dim; int dim;
double sigma; /* step size */ double sigma; /* step size */
double *rgxmean; /* mean x vector, "parent" */ double *rgxmean; /* mean x vector, "parent" */
...@@ -70,7 +83,7 @@ public: ...@@ -70,7 +83,7 @@ public:
Caleatoire alea; /* random number generator */ Caleatoire alea; /* random number generator */
int seed; int seed;
public: public:
CCmaes(int lambda, int mu, int problemdim); CCmaes(int lambda, int mu, int problemdim);
~CCmaes(); ~CCmaes();
void cmaes_update(double **popparent, double *fitness); void cmaes_update(double **popparent, double *fitness);
......
...@@ -8,9 +8,17 @@ ...@@ -8,9 +8,17 @@
#ifndef CCMAES_H_ #ifndef CCMAES_H_
#define CCMAES_H_ #define CCMAES_H_
#include "define.h" #include "define.h"
/**
* \class CaleatoireCuda
* \brief Random generator for CMA-ES CUDA
* \details Randomness using Gaussian or Uniform distribution.CUDA version of
* class Caleatoire.
*
**/
class CaleatoireCuda class CaleatoireCuda
{ {
public: public:
/* Variables for Uniform() */ /* Variables for Uniform() */
long int startseed; long int startseed;
long int aktseed; long int aktseed;
...@@ -20,16 +28,23 @@ public: ...@@ -20,16 +28,23 @@ public:
/* Variables for Gauss() */ /* Variables for Gauss() */
short flgstored; short flgstored;
float hold; float hold;
public: public:
long alea_Start(long unsigned inseed); long alea_Start(long unsigned inseed);
long alea_init(long unsigned inseed); long alea_init(long unsigned inseed);
float alea_Gauss(); float alea_Gauss();
float alea_Uniform(); float alea_Uniform();
}; };
/**
* \class CCmaesCuda
* \brief Covariance Matrix Adaptation Evolution Strategy for CUDA
* \details Is set before entering the main evolutionary loop. CUDA version of
* class CCmaes
*
**/
class CCmaesCuda{ class CCmaesCuda{
//random_t rand; /* random number generator */ //random_t rand; /* random number generator */
public: public:
int dim; int dim;
float sigma; /* step size */ float sigma; /* step size */
float *rgxmean; /* mean x vector, "parent" */ float *rgxmean; /* mean x vector, "parent" */
...@@ -70,7 +85,7 @@ public: ...@@ -70,7 +85,7 @@ public:
CaleatoireCuda alea; /* random number generator */ CaleatoireCuda alea; /* random number generator */
int seed; int seed;
public: public:
CCmaesCuda(int lambda, int mu, int problemdim); CCmaesCuda(int lambda, int mu, int problemdim);
~CCmaesCuda(); ~CCmaesCuda();
void cmaes_update(float **popparent, float *fitness); void cmaes_update(float **popparent, float *fitness);
......
/**
* @file CGPNode.h
* @version 1.0
*
**/
#ifndef __C_GPNODE__ #ifndef __C_GPNODE__
#define __C_GPNODE__ #define __C_GPNODE__
...@@ -7,9 +13,15 @@ using namespace std; ...@@ -7,9 +13,15 @@ using namespace std;
#define MAX_ARITY 2 // maximum arrity for GP node #define MAX_ARITY 2 // maximum arrity for GP node
/**
* \class GPNode
* \brief Genetic Programming
* \details Used to modelised nodes of abstract syntax tree
*
**/
class GPNode { class GPNode {
public: public:
GPNode(){ // Constructor GPNode(){ // Constructor
...@@ -17,61 +29,79 @@ public: ...@@ -17,61 +29,79 @@ public:
children[EASEA_Ndx]=NULL; children[EASEA_Ndx]=NULL;
} }
GPNode(int var_id, double erc_value, char opCode, GPNode** childrenToAdd) : var_id(var_id), erc_value(erc_value), opCode(opCode)// other constructor GPNode(int var_id, double erc_value, char opCode, GPNode** childrenToAdd) : var_id(var_id), erc_value(erc_value), opCode(opCode)// other constructor
{ {
for(int EASEA_Ndx=0; EASEA_Ndx<2; EASEA_Ndx++) for(int EASEA_Ndx=0; EASEA_Ndx<2; EASEA_Ndx++)
this->children[EASEA_Ndx]=childrenToAdd[EASEA_Ndx]; this->children[EASEA_Ndx]=childrenToAdd[EASEA_Ndx];
} }
GPNode(const GPNode &EASEA_Var) { // Copy constructor GPNode(const GPNode &EASEA_Var) { // Copy constructor
var_id=EASEA_Var.var_id; var_id=EASEA_Var.var_id;
erc_value=EASEA_Var.erc_value; erc_value=EASEA_Var.erc_value;
//arity=EASEA_Var.arity; //arity=EASEA_Var.arity;
opCode=EASEA_Var.opCode; opCode=EASEA_Var.opCode;
for(int EASEA_Ndx=0; EASEA_Ndx<2; EASEA_Ndx++) for(int EASEA_Ndx=0; EASEA_Ndx<2; EASEA_Ndx++)
if( EASEA_Var.children[EASEA_Ndx] ) children[EASEA_Ndx] = new GPNode(*(EASEA_Var.children[EASEA_Ndx])); if( EASEA_Var.children[EASEA_Ndx] ) children[EASEA_Ndx] = new GPNode(*(EASEA_Var.children[EASEA_Ndx]));
else children[EASEA_Ndx] = NULL; else children[EASEA_Ndx] = NULL;
} }
virtual ~GPNode() { // Destructor virtual ~GPNode() { // Destructor
for(int EASEA_Ndx=0; EASEA_Ndx<2; EASEA_Ndx++) for(int EASEA_Ndx=0; EASEA_Ndx<2; EASEA_Ndx++)
if( children[EASEA_Ndx] ) delete children[EASEA_Ndx]; if( children[EASEA_Ndx] ) delete children[EASEA_Ndx];
} }
GPNode& operator=(const GPNode &EASEA_Var) { // Operator= GPNode& operator=(const GPNode &EASEA_Var) { // Operator=
if (&EASEA_Var == this) return *this; if (&EASEA_Var == this) return *this;
var_id = EASEA_Var.var_id; var_id = EASEA_Var.var_id;
erc_value = EASEA_Var.erc_value; erc_value = EASEA_Var.erc_value;
//arity = EASEA_Var.arity; //arity = EASEA_Var.arity;
opCode = EASEA_Var.opCode; opCode = EASEA_Var.opCode;
for(int EASEA_Ndx=0; EASEA_Ndx<2; EASEA_Ndx++) for(int EASEA_Ndx=0; EASEA_Ndx<2; EASEA_Ndx++)
if(EASEA_Var.children[EASEA_Ndx]) children[EASEA_Ndx] = new GPNode(*(EASEA_Var.children[EASEA_Ndx])); if(EASEA_Var.children[EASEA_Ndx]) children[EASEA_Ndx] = new GPNode(*(EASEA_Var.children[EASEA_Ndx]));
return *this; return *this;
} }
bool operator==(GPNode &EASEA_Var) const { // Operator== bool operator==(GPNode &EASEA_Var) const { // Operator==
if (var_id!=EASEA_Var.var_id) return false; if (var_id!=EASEA_Var.var_id) return false;
if (erc_value!=EASEA_Var.erc_value) return false; if (erc_value!=EASEA_Var.erc_value) return false;
//if (arity!=EASEA_Var.arity) return false; //if (arity!=EASEA_Var.arity) return false;
if (opCode!=EASEA_Var.opCode) return false; if (opCode!=EASEA_Var.opCode) return false;
{for(int EASEA_Ndx=0; EASEA_Ndx<2; EASEA_Ndx++) {for(int EASEA_Ndx=0; EASEA_Ndx<2; EASEA_Ndx++)
if (children[EASEA_Ndx]!=EASEA_Var.children[EASEA_Ndx]) return false;} if (children[EASEA_Ndx]!=EASEA_Var.children[EASEA_Ndx]) return false;}
return true; return true;
} }
bool operator!=(GPNode &EASEA_Var) const {return !(*this==EASEA_Var);} // operator!= bool operator!=(GPNode &EASEA_Var) const {return !(*this==EASEA_Var);} // operator!=
friend ostream& operator<< (ostream& os, const GPNode& EASEA_Var) { // Output stream insertion operator friend ostream& operator<< (ostream& os, const GPNode& EASEA_Var) { // Output stream insertion operator
os << "var_id:" << EASEA_Var.var_id << "\n"; os << "var_id:" << EASEA_Var.var_id << "\n";
os << "erc_value:" << EASEA_Var.erc_value << "\n"; os << "erc_value:" << EASEA_Var.erc_value << "\n";
//os << "arity:" << EASEA_Var.arity << "\n"; //os << "arity:" << EASEA_Var.arity << "\n";
os << "opCode:" << EASEA_Var.opCode << "\n"; os << "opCode:" << EASEA_Var.opCode << "\n";
{os << "Array children : "; {os << "Array children : ";
for(int EASEA_Ndx=0; EASEA_Ndx<2; EASEA_Ndx++) for(int EASEA_Ndx=0; EASEA_Ndx<2; EASEA_Ndx++)
if( EASEA_Var.children[EASEA_Ndx] ) os << "[" << EASEA_Ndx << "]:" << *(EASEA_Var.children[EASEA_Ndx]) << "\t";} if( EASEA_Var.children[EASEA_Ndx] ) os << "[" << EASEA_Ndx << "]:" << *(EASEA_Var.children[EASEA_Ndx]) << "\t";}
os << "\n"; os << "\n";
return os; return os;
} }
// Class members
// Class members
int var_id; int var_id;
double erc_value; double erc_value;
// char opCode; // char opCode;
......
...@@ -13,13 +13,20 @@ class CRandomGenerator; ...@@ -13,13 +13,20 @@ class CRandomGenerator;
#include <stdlib.h> #include <stdlib.h>
#include "Parameters.h" #include "Parameters.h"
/**
* \class CGrapher
* \brief Launch the grapher within EASEA
* \details Launch the java grapher in a exec'd fork.
* TODO:(re)Implement the constructor for Windows.
**/
class CGrapher { class CGrapher {
public: public:
FILE *fWrit; FILE *fWrit;
FILE *fRead; FILE *fRead;
int pid; int pid;
int valid; int valid;
public: public:
CGrapher(Parameters* param, char* title); CGrapher(Parameters* param, char* title);
~CGrapher(); ~CGrapher();
}; };
......
...@@ -12,12 +12,12 @@ class CRandomGenerator; ...@@ -12,12 +12,12 @@ class CRandomGenerator;
#include <iostream> #include <iostream>
class CIndividual { class CIndividual {
public: public:
bool valid; bool valid;
bool isImmigrant; bool isImmigrant;
float fitness; float fitness;
static CRandomGenerator* rg; static CRandomGenerator* rg;
public: public:
CIndividual(); CIndividual();
//CIndividual(const CIndividual& indiv); //CIndividual(const CIndividual& indiv);
virtual ~CIndividual(); virtual ~CIndividual();
......
...@@ -27,7 +27,7 @@ class CStats; ...@@ -27,7 +27,7 @@ class CStats;
class CPopulation { class CPopulation {
public: public:
float pCrossover; float pCrossover;
float pMutation; float pMutation;
...@@ -62,7 +62,8 @@ public: ...@@ -62,7 +62,8 @@ public:
public: public:
CPopulation(); CPopulation();
CPopulation(unsigned parentPopulationSize, unsigned offspringPopulationSize, CPopulation(unsigned parentPopulationSize, unsigned offspringPopulationSize,
float pCrossover, float pMutation, float pMutationPerGene, CRandomGenerator* rg, Parameters* params, CStats* cstats); float pCrossover, float pMutation, float pMutationPerGene,
CRandomGenerator* rg, Parameters* params, CStats* cstats);
virtual ~CPopulation(); virtual ~CPopulation();
//virtual void initializeParentPopulation() = 0; //virtual void initializeParentPopulation() = 0;
...@@ -73,12 +74,18 @@ public: ...@@ -73,12 +74,18 @@ public:
virtual void evaluateParentPopulation(); virtual void evaluateParentPopulation();
virtual void optimiseParentPopulation(); virtual void optimiseParentPopulation();
void strongElitism(unsigned elitismSize, CIndividual** population, unsigned populationSize, CIndividual** outPopulation, unsigned outPopulationSize); void strongElitism(unsigned elitismSize, CIndividual** population, unsigned populationSize,
void weakElitism(unsigned elitismSize, CIndividual** parentsPopulation, CIndividual** offspringPopulation, unsigned* parentPopSize, unsigned* offPopSize, CIndividual** outPopulation, unsigned outPopulationSize); CIndividual** outPopulation, unsigned outPopulationSize);
void weakElitism(unsigned elitismSize, CIndividual** parentsPopulation,
CIndividual** offspringPopulation, unsigned* parentPopSize, unsigned* offPopSize,
CIndividual** outPopulation, unsigned outPopulationSize);
virtual void evaluateOffspringPopulation(); virtual void evaluateOffspringPopulation();
virtual void optimiseOffspringPopulation(); virtual void optimiseOffspringPopulation();
CIndividual** reducePopulations(CIndividual** population, unsigned populationSize,CIndividual** reducedPopulation, unsigned obSize,int pressure);
CIndividual** reducePopulations(CIndividual** population, unsigned populationSize,
CIndividual** reducedPopulation, unsigned obSize,int pressure);
CIndividual** reduceParentPopulation(unsigned obSize); CIndividual** reduceParentPopulation(unsigned obSize);
CIndividual** reduceOffspringPopulation(unsigned obSize); CIndividual** reduceOffspringPopulation(unsigned obSize);
void reduceTotalPopulation(CIndividual** elitPop); void reduceTotalPopulation(CIndividual** elitPop);
...@@ -118,6 +125,7 @@ public: ...@@ -118,6 +125,7 @@ public:
static void reducePopulation(CIndividual** population, unsigned populationSize, static void reducePopulation(CIndividual** population, unsigned populationSize,
CIndividual** reducedPopulation, unsigned obSize, CIndividual** reducedPopulation, unsigned obSize,
CSelectionOperator* replacementOperator,int pressure); CSelectionOperator* replacementOperator,int pressure);
void syncOutVector(); void syncOutVector();
void syncInVector(); void syncInVector();
......
...@@ -14,7 +14,7 @@ class CRandomGenerator { ...@@ -14,7 +14,7 @@ class CRandomGenerator {
private: private:
unsigned seed; unsigned seed;
MTRand* mt_rnd; MTRand* mt_rnd;
public: public:
CRandomGenerator(unsigned int seed); CRandomGenerator(unsigned int seed);
~CRandomGenerator(); ~CRandomGenerator();
int randInt(); int randInt();
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
#include <string> #include <string>
class CSelectionOperator { class CSelectionOperator {
public: public:
virtual void initialize(CIndividual** population, float selectionPressure, size_t populationSize); virtual void initialize(CIndividual** population, float selectionPressure, size_t populationSize);
virtual size_t selectNext(size_t populationSize); virtual size_t selectNext(size_t populationSize);
virtual float getExtremum() = 0 ; virtual float getExtremum() = 0 ;
virtual ~CSelectionOperator(){;} virtual ~CSelectionOperator(){;}
protected: protected:
CIndividual** population; CIndividual** population;
float currentSelectionPressure; float currentSelectionPressure;
}; };
...@@ -28,14 +28,14 @@ extern CSelectionOperator* getSelectionOperator(std::string selectop, int minimi ...@@ -28,14 +28,14 @@ extern CSelectionOperator* getSelectionOperator(std::string selectop, int minimi
/* **************************************** /* ****************************************
Tournament classes (min and max) Tournament classes (min and max)
****************************************/ ****************************************/
class MaxTournament : public CSelectionOperator{ class MaxTournament : public CSelectionOperator{
public: public:
MaxTournament(CRandomGenerator* rg){ this->rg = rg; } MaxTournament(CRandomGenerator* rg){ this->rg = rg; }
virtual void initialize(CIndividual** population, float selectionPressure, size_t populationSize); virtual void initialize(CIndividual** population, float selectionPressure, size_t populationSize);
virtual size_t selectNext(size_t populationSize); virtual size_t selectNext(size_t populationSize);
float getExtremum(); float getExtremum();
private: private:
CRandomGenerator* rg; CRandomGenerator* rg;
}; };
...@@ -43,12 +43,12 @@ private: ...@@ -43,12 +43,12 @@ private:
class MinTournament : public CSelectionOperator{ class MinTournament : public CSelectionOperator{
public: public:
MinTournament(CRandomGenerator* rg){ this->rg = rg; } MinTournament(CRandomGenerator* rg){ this->rg = rg; }
virtual void initialize(CIndividual** population, float selectionPressure, size_t populationSize); virtual void initialize(CIndividual** population, float selectionPressure, size_t populationSize);
virtual size_t selectNext(size_t populationSize); virtual size_t selectNext(size_t populationSize);
float getExtremum(); float getExtremum();
private: private:
CRandomGenerator* rg; CRandomGenerator* rg;
}; };
...@@ -102,12 +102,12 @@ class MinRandom : public CSelectionOperator{ ...@@ -102,12 +102,12 @@ class MinRandom : public CSelectionOperator{
*****************************************/ *****************************************/
class MaxRoulette : public CSelectionOperator{ class MaxRoulette : public CSelectionOperator{
public: public:
MaxRoulette(CRandomGenerator* rg){ this->rg = rg; } MaxRoulette(CRandomGenerator* rg){ this->rg = rg; }
virtual void initialize(CIndividual** population, float selectionPressure, size_t populationSize); virtual void initialize(CIndividual** population, float selectionPressure, size_t populationSize);
virtual size_t selectNext(size_t populationSize); virtual size_t selectNext(size_t populationSize);
float getExtremum(); float getExtremum();
private: private:
size_t populationSize; size_t populationSize;
CRandomGenerator* rg; CRandomGenerator* rg;
}; };
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
class CStats{ class CStats{
public: public:
int totalNumberOfImmigrants; int totalNumberOfImmigrants;
int currentNumberOfImmigrants; int currentNumberOfImmigrants;
...@@ -13,7 +13,7 @@ public: ...@@ -13,7 +13,7 @@ public:
double currentAverageFitness; double currentAverageFitness;
double currentStdDev; double currentStdDev;
public: public:
CStats(); CStats();
~CStats(); ~CStats();
void resetCurrentStats(); void resetCurrentStats();
......
...@@ -23,10 +23,10 @@ class CEvolutionaryAlgorithm; ...@@ -23,10 +23,10 @@ class CEvolutionaryAlgorithm;
/* **************************************** /* ****************************************
StoppingCriterion class StoppingCriterion class
****************************************/ ****************************************/
class CStoppingCriterion { class CStoppingCriterion {
public: public:
virtual bool reached() = 0; virtual bool reached() = 0;
virtual ~CStoppingCriterion(){;} virtual ~CStoppingCriterion(){;}
}; };
...@@ -34,7 +34,7 @@ public: ...@@ -34,7 +34,7 @@ public:
/* **************************************** /* ****************************************
GenerationalCriterion class GenerationalCriterion class