📄 max.h
字号:
#ifndef MAX_LIB#define MAX_LIB true// max.h Include file for max problem// W. Langdon cs.ucl.ac.uk 13 December 1996// version "$Revision: 1.5 $"//Modifications (in reverse order)//WBL 19 Apr 1997 For Easter release. Add ORIGINAL_LOOP to keep compilers happy//WBL 13 Dec 1996//#define ADF true//#define BYREF true//#define TIMINGS true//#define VAR_TIMINGS true//#define TRACE_RUN true//#define ADF_CACHE true//#define STORE_FIT true//STORE_FIT requires MULTREE and TRACE//#define GEN_MEM true// uniform argument and return type for "closure"typedef float retval;#define GENERATIONAL true//#define PARETO// Support for multiple trees within one individual in pop WBL// Only tested with FASTEVAL so far// Too much hassel to undo now#define MULTREE// keep and print genelogical trace info//#define TRACE#define NUM_TREES 1#define MAXTREEDEPTH 9#define NUM_OPERATIONS 1#define NUM_OTHERS 0#define num_pareto_components 1#define num_ellite_pareto 1//#define pareto_fitness(x) &(x->hits[0]) --- moved to gp.h//#define pareto_fitness(x,i) scoretype(x->fvalue)#define store_limit 1#define Array_bot 0#define Array_top 0//#define GENETIC_MEM_SIZE 20#define max_iterates 0#define loop_max_depth 4#define print_buffer_size 10inline float print_match_max_score (int x) {return ((x==0)? 0.05 : 1.0);}inline float print_match_length_score(int x, int y) {#ifdef ORIGINAL_PRINT_MATCH return ((x!=y)? 0.0 : (x==0)? 0.05 : 0.2);}#else return ((x==0)? 0.05:0.2) * ((x==y)? 1.0:0.5/abs(x-y));}#endifinline float print_match_item_score (int x) {return (0.4/(x));}inline float print_match_order_score (int x) {return (0.4/(x));}typedef float scoretype;//#define mem_penalty_bot MAXINT//#define cpu_penalty_bot 100000//the following not used.. but need to keep compier happy#define MAX_BREAKS 1#define NUM_TEST_SEQUENCES 1#define NUM_TEST_PHASES 1//enum{week/*,adf1,adf2,adf3,adf4*/};//#define first_op line//#define last_op week#define last_op 0//extern const int tree_arg_num [last_op+1];//extern const BOOL tree_return_value[last_op+1];//not actually problem dependant but keep include files a bit cleanerretval random_value(int& seed); //seed > 0extern float max_fitness;#define setmaxfit(xparams) (pow(4,(pow(2,(xparams->params[pMaxDepth]-4)))))//define setmaxfit(xparams) max_fitness //alternative nop definitionextern int end_gens(); //see if need to move to the next test phase //return <> 0 if wish to save a bench pointextern num_sol_found; //for save and restore to dumpfile//Restore original single "i0" without depth restriction described in thesis#define ORIGINAL_LOOP true#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -