📄 population.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 POPULATION_H
#define POPULATION_H
#include <math.h>
#include <iostream.h>
#include <fstream.h>
#include <vector>
#include "classifier.h"
#include "random.h"
class Population
{
public:
Population(int seed);
~Population();
int getPopSize();
int getNumMacro(){return c_classifiers.size();};
void addClassifier(Classifier * c);
Classifier* getClassifierC(int i);
int getClassifierP(Classifier *c);
void deleteClassifier(int i);
void deleteFromPopulation();
void deletePartialPopulation(double);
double deleteVote(Classifier *cl, double avgFitInPop);
void emptyPopulation();
void reinitParam();
void statistic(ofstream &filename);
void snapshotReport(ofstream &filename);
int* getNumMacroInRegion();
int* getMPRules();
int getNumNewRules();
int getNumDeleteRules();
int** getBBData();
#ifdef MP
//schema 0:00***0
//schema 1:00***1
//schema 2:01**0*
//schema 3:01**1*
//schema 4:10*0**
//schema 5:10*1**
//schema 6:110***
//schema 7:111***
double* getNumSchemas(double, int);
double* getNumClassifiersInSchema(double, int);
#endif
private:
std::vector<Classifier*> c_classifiers;
Random *random;
int num_new_rules;
int num_delete_rules;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -