📄 declare.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 DECLARE_H
#define DECLARE_H
/*Define Problem */
#define REAL_6MULTIPLEXER
//#define CHECKERBOARD
/*Noise Type */
//#define COND_NOISE
#define CLASS_NOISE
#define UNBIAS
#ifdef REAL_6MULTIPLEXER
//Multiplex problem
const int COND_OFFSET = 6; // Length of Condition
const int DATA_OFFSET = 4; // Length of data part of the multiplexer problem
const int ADDR_OFFSET = 2;
//Steps setup
const int CNEPOCHS = 200000;
const int DYN_CYCLE = 100000;
//const double REAL_THRESHOLD = 0.5; // Threshold for converting a real number to binary number
#define REAL
#define MP
#endif
#ifdef CHECKERBOARD
const int COND_OFFSET = 3; //Number of dimentions
const int DIM_SIZE = 3; //Number of hypercube
//Steps setup
const int CNEPOCHS = 100000;
#define REAL
#endif
const int MAX_DYN_CYCLE = 20;
const double EPSILON = 0.01;
const int NACTION = 2; //Number of actions
const int WINDOW_SIZE = 100;
//Initial value
const double FITNESS = 0.01;
const double PREDICTION = 10.0;
const double PERROR = 0;
const double PDONTCARE = 0.66;// the probability of using a # in one attribute in C when covering
//XCS parameters setup
const int MAX_POP_SIZE = 20000;
const double REWARD = 1000.0; // Reward payment
const double TNMSIZE = 0.4; //Tournament size
const double THETASUB = 20; //The subsumption threshold. The exeperience of a classifier
//must be greater then the threshold in order to be able to
//subsume another classifier
const double DEALTASUB = 0.001;
const int THETADEL = 20; //Deletion threshold. if a classifier has an experience is greater
// than this threshold, its fitness may be considered in its probability
// of deletion
const double DELTA = 0.1; // fraction of the mean fitness in [p] below which the fitness of
// a classifier may be considered in its probalility of deletion
const double EPSILON0 = 10; //Tolerance error in prediction error
const double ALPHA = 0.1; //
const double ALPHA1 = 0.005; // Decides curve of a learning rate function
const double BETA_MIN = 0.2; //Learning rate parameter
const double BETA_MAX = 1;
const double GAMMA = 0; //Discount factor
const int THETA_GA = 12; // Do a GA in the [M] if the average number of time stesp since the last GA is greater this number
const int NU = 5; //Exponent of power function
const int THETA_MNA = NACTION;//The minimal number of actions that must be present in a match set,
const int DOFITNESSFIRST = 1;
const int THETA_NUM_ACTION = NACTION;
//Others
const int TRUE = 1;
const int FALSE = 0;
const int TRAINING = 0;
const int TESTING = 1;
const int CROSS_ONE = 1;
const int CROSS_TWO = 2;
const int CROSS_UNI = 3;
const int CROSS_TWO_WITHIN = 4;
const int CROSS_TWO_BETWEEN = 5;
const int CROSS_TWO_WITHIN2 = 6;
//Dynamic Environments
const double ACCEPTED_ERROR = 0.1;
const double DELTA_ERROR = 0.1;
const int TRADITIONAL_MODEL = 0;
const int REINIT_POP_MODEL = 1;
const int REINIT_PARAM_MODEL = 2;
const int ADAPTIVE_LEARNING_MODEL = 3;
//Real Representation
const int MIN_MAX = 1;
const int CENTER_SPREAD = 2;
const int CENTER_PERCENTAGE = 3;
const int MIN_PERCENTAGE = 4;
const int UNBIAS_COVER = 0;
const int STANDARD_COVER = 1;
const int RESTRICTED_COVER = 2;
#ifdef REAL
const double UPPER_BOUND = 1.0;
const double LOWER_BOUND = 0.0;
const double SPREAD_THRESHOLD = 1.0; //
const double MUTATION_THRESHOLD = 0.1; // Thredshold for identifying a value for mutation
struct d_interval_t {
double point1[COND_OFFSET];
double point2[COND_OFFSET];
#ifdef NOISE_AT_ALLELE
double noise[COND_OFFSET];
#endif
int action;
} ;
struct input_t{
double attrs[COND_OFFSET];
int action;
};
#endif
#ifdef BINARY
struct d_interval_t
{
char condition[COND_OFFSET];
int action;
};
struct input_t{
char condition[COND_OFFSET];
int action;
};
#endif
#ifdef INT
const int MUTATION_THRESHOLD = 4;
const int COVER_THRESHOLD = 4;
const int UPPER_BOUND = 11;
const int LOWER_BOUND = 0;
struct d_interval_t
{
int point1[COND_OFFSET];
int point2[COND_OFFSET];
int action;
};
struct input_t{
int attrs[COND_OFFSET];
int action;
};
#endif
//Global Variables
//extern double mrate;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -