ECF 1.5
Classifier.h
1#ifndef CLASSIFIER_H
2#define CLASSIFIER_H
3
4#include "../Algorithm.h"
5#include "../bitstring/BitString.h"
6
7#include "XCSParams.h"
8#include "ClassifierParams.h"
9
10#include <set>
11
12class Classifier;
13typedef boost::shared_ptr<Classifier> ClassifierP;
14
21
22public:
23
24 IndividualP ind;
25 ClassifierParamsP params;
26 XCSParamsP xcsParams;
27
28 Classifier(XCSParamsP xcsParams, unsigned long long int time, IndividualP ind, StateP state);
29 Classifier (ClassifierP cl);
30 static bool checkState(const StateP state);
31
32 void cover (std::set<int> actions, const GenotypeP input,StateP state);
33 bool doesMatch(const GenotypeP input);
34 int getActionId();
35 GenotypeP getAction();
36 void setAction(GenotypeP action);
37
38 void mutateRule(GenotypeP input, StateP state);
39 void mutateAction(StateP state);
40
41 bool valid;
42
43 void print();
44 //TODO std::string toString();
45
46#pragma region BitString specific
47 static void printBitString (const BitStringP bString);
48 BitStringP getRuleBitString();
49 BitStringP getDontCareBitString();
50#pragma endregion
51
52public:
53 double getDeletionVote(double avFit);
54 bool couldSubsume();
55 int numOfDCBits();
56 bool isMoreGeneral(ClassifierP cl);
57 bool doesSubsume(ClassifierP cl);
58
59 double getPrediction();
60 double getError();
61 double getFitness();
62
63 unsigned long long int getTimeStamp();
64 int getNumerosity();
65 double getActSetSize();
66 double getExperience();
67
68 void setPrediction(double p);
69 void setError(double eps);
70 void setFitness(double F);
71
72 void setTimeStamp(unsigned long long int ts);
73 void setNumerosity(int num);
74 void setActSetSize(double as);
75 void setExperience(double exp);
76
77private:
78 void printRuleString (const BitStringP bString, const BitStringP hashString);
79};
80
81
82#endif
Classifier class that holds all parameters and pointer to individual to which the parameters belong.
Definition: Classifier.h:20