⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xcsmacros.h

📁 Simple GA code (Pascal code from Goldberg, D. E. (1989), Genetic Algorithms in Search, Optimization,
💻 H
字号:
/*/       (XCS-C 1.2)/	------------------------------------/	Learning Classifier System based on accuracy//     by /     Martin V. Butz/     Illinois Genetic Algorithms Laboratory (IlliGAL)/     University of Illinois at Urbana/Champaign/     butz@illigal.ge.uiuc.edu//     Last modified: 09-30-2003//     The main header with all macro values which can be considered as default values./     Parameter settings can be changed here however it is encouraged to read in a separate macro file.*/#define TAB_OUT_FILE "XCS_TEST" /* the output file for the results */#define NR_EXPS 1 /* the number of experiments to take */#define MAX_NR_STEPS 20000 /* the number of problems to solve in one experiment */#define TEST_FREQUENCY 200 /* the frequency knowledge tests are executed */#define MAX_POP_SIZE 2000 /* default=2000 (highly problem dependent); the maximum size of the population */#define INITIALIZE_POPULATION 0 /* default=0; Boolean to check if population should be initialized */#define ALPHA 0.1  /* default=0.1; decreases the accuracy value if classifier's prediction error is */		   /* higher than EPSILON_0*PAYMENT_RANGE.		    * This constant results in a gap between accurate and not accurate classifiers */#define BETA 0.2   /* default=0.2; Learning Rate parameter */#define GAMMA 0.95 /* default=0.95; Discounting factor that discounts the maximum of the prediction array */#define EPSILON_0 0.01 /* default=0.01; TOLERATED ERROR in prediction error*/#define NU 5. /* default=5; exponent of the power function */#define THETA_GA 25 /* default=25; run GA if the average of the last GA application in the set is greater than THETA_GA */#define FITNESS_REDUCTION 1 /* default=1; reduce the fitness of the offspring classifier */#define TOURNAMENT_SIZE 0.4 /* default=0.4; percentage of action set that takes part in tournament; if set to zero, proportionate selection is used; if set greater than one, tournament with fixed size is used */#define FORCE_DIFFERENT_IN_TOURNAMENT 0 /* default =0; the probability that the two participants must be different */#define SELECT_TOLERANCE 0.001 /* default=.001; the tolerance with which classifier fitness/error is considered similar */#define CROSSOVER_TYPE 0 /* default=0; 0=uniform, 1=one-point, 2=two-point */#define CHI_GA 1.0 /* default=1.0; the probability to do crossover */#define MU_GA 0.01 /* default=0.01 (problem dependent); probability of mutating one bit */#define DO_GENERALIZATION_MUTATION 0 /* default=0; flag for only generalization in mutation */#define DO_NICHE_MUTATION 0 /* default=0; flag for applying niche mutation instead of a general mutation */#define DO_MAM 1 /* default=1; determines if Moyenne Adaptive Modifee should be applied */#define DO_GA_ERROR_BASED_SELECT 0 /* default=0; GA selection based on error */#define DELTA 0.1 /* default=0.1; used to enforce the deletion of low fitness classifiers (= second deletion method) once they reached DELETION_EXPERIENCE */#define THETA_DEL 20 /* default=20; The experience required to use second deletion method */#define DELETION_TYPE 1 /* default=1; 0=random deletion, 1=fitness and |[A]| bias, 2=fitness bias only, 3=|[A]| bias only ; 4=error bias only; 5=error and |[A]| bias */#define DONT_CARE_PROB 0.66 /* default=0.66 (problem dependent); Probability of choosing DONT_CARE in a newly generated classifier */#define DO_GA_SUBSUMPTION 1 /* default=1; flag for applying GA subsumption */#define DO_ACTION_SET_SUBSUMPTION 0 /* default=0; flag for applying action set subsumption */#define THETA_SUB 20 /* default=20; the experience required before can be subsumed */#define EXPLORE_PROB 1.0 /* default=1; The probability of choosing a random action while learning */#define TELETRANSPORTATION 50 /* default=50; possible teletransportation in multi step environments (trial ends if counter exeeds this number) *//* The following parameters cannot be altered with the parameter file */#define PRE_INI 10.0 /* default=10; prediction initialization in new classifiers */#define PREER_INI 0.0 /* default=0; prediction error initialization in new classifiers */#define FIT_INI 0.01 /* default=0.01; fitness initialization in new classifiers */#define DO_FITNESSUPDATE_FIRST 0 /* default=0; flag detemines when the fitness is updated */#define UPDATEORDER_PRED_PREDERROR 0 /* default=0; determines if the prediction should be updated before the prediction error */#define DONT_CARE '#' /* the don't care symbol */#define _M 2147483647     /* modulus of PMMLCG (default=2147483647=2^31 - 1)*/#define _A 16807          /* default=16807*/double urand();double nrand();long setSeed(long newSeed);void randomize(void);int getIntValue(char *string);double getDoubleValue(char *string);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -