📄 ga.h
字号:
/* XCSR_DE1.0
* --------------------------------------------------------
* Learning classifier system based on accuracy in dynamic environments
*
* by Huong Hai (Helen) Dam
* z3140959@itee.adfa.edu.au
* UNSW @ ADFA, Canberra Australia
* Artificial Life and Adaptive Robotics Laboratory
* http://www.itee.adfa.edu.au/~alar
*
* Last modified: 24-11-2005
*
*/
#ifndef GA_H
#define GA_H
#include <fstream.h>
#include <iostream.h>
#include "population.h"
#include "classifier.h"
class GA{
public:
GA(int seed, int generation, double crate, double mrate , int rep_type);
~GA();
void discoveryComponent(Population *pop,int *actset, int naset, int time);
void GASubsumes(Population *pop,Classifier *child1, Classifier *mate1, Classifier *mate2);
int subsumes(Classifier *child, Classifier *parent);
int isMoreGeneral(Classifier *parent, Classifier *child);
int rouletteWheelSelection(Population *pop,int *actset, int naset);
int tournamentSelection(Population *pop,int *actset, int naset, int selected);
void mutation(d_interval_t *interval);
void crossover(int type, Classifier *mate1, Classifier *mate2, Classifier *child1, Classifier *child2);
void insertInPopulation(Population *pop,Classifier *child);
void generateCovering();
void setTimeStamp(int *actset, int naset, int time);
double getAvgTime(Population *pop,int *actset, int naset);
private:
int generation;
Random *random;
int maxpopsize;
double crate;
double mrate;
int rep_type;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -