📄 lang.h
字号:
/****************************************************************************//* <prob.h> file *//* lang.h *//* All labels #defined in this section must be given a definition, except *//* in those sections for the user to declare/define user variables/terms *//* These instances are specifically labelled. *//****************************************************************************//*Problem specification -- for archival purposes only*/#define PROBLEM "Problem \t Language Acceptor w/ No ADFS\n"#define ENVIRON "Environ \t init w/ {}\n"#define FUNK "Funk \t nnao\n"#define ZVALUE "z \t 99%\n"/****************************************************************************//* Various Compile Options -- mostly don't have to change*/#define POINT_TYPING OFF /*ON or OFF*/#define HISTOGRAMS OFF#define END_ON_SUCCESS ON /*if this is defined, the run stops on the first success*/#define OLDSTYLE_OUTPUT ON /*An odd visual basic parameter -- */ #define DO_POOR_WHITE_TRASH_AUDIT OFF#define FUNCREPORT ON /*Prints a report on the function set*/#define PRINTFVECTOR OFF#define PTREE OFF#define DEBUG_READ_DUDE OFF#define SQUISH_PRINT ON /*Prints in compacted form*/#define USE_USER_GENERATION_RPBS OFF#define USE_USER_GENERATION_ADFS OFF#define PRINT_INITIAL_POPULATION OFF#define USE_NO_LEAF_CROSSOVER OFF#define SIZE_WEIGHTED_CROSSOVER_BRANCH_SELECTION FALSE#define NON_32_BIT_OBJECTS_IN_FIT_CASES FALSE /****************************************************************************//* DEFINE PARAMETERS FOR ARCHITECTURE OF INDIVIDUALS */#define NUM_RPBS 1 /*Number of result producing branches*/#define MAX_NUM_ADFS 3 /*Total maximum number of adfs*/#define NUM_INITIAL_ADFS 3 /*Number of adfs initially available to the */#define MAX_NUM_ADF_ARGS 0#define MIN_NUM_ADF_ARGS 0#define MAX_NUM_ARGS 3#define MAX_NUM_NODES_PER_DUDE 1004 /*Must be greater than the sum of outputs*/ /*produced by the GetBranchSize function*/ /****************************************************************************//* Set the TYPE of the problem */#define GTYPE int#define GFORMAT "%d"#define RAND_CODE make_RandomInt /*Function used to create random */ /*constants, if they are used */#define GPRINT_CONST(fp,stuff) fprintf(fp,"%d",stuff)/* GPRINT_CONST is a function used to print random constants for this problem, if they are used*//****************************************************************************/#define TOTAL_NUMBER_OF_FUNCTIONS 13/*Note, this number should include all adfs, dummy_args, functions, terminals,and the random constant (whether or not the random constant is used*/ /****************************************************************************//* VARIOUS RUN PARAMETERS */#define MAX_NEW_TREE_DEPTH 7#define MAX_DEPTH_FOR_MUTATION 4#define CROSSOVER_FRACTION_FOR_LEAVES 0.10#define CROSSOVER_FRACTION_FOR_NODE 0.80#define MUTATION_FRACTION 0.00#define COPY_FRACTION 0.10#define BRANCH_CREATION_FRACTION 0.00#define BRANCH_DUPLICATION_FRACTION 0.00#define BRANCH_DELETION_FRACTION 0.00#define ARG_DUPLICATION_FRACTION 0.00#define ARG_DELETION_FRACTION 0.00#define EARLY_CROSSOVER_FRACTION_FOR_LEAVES 0.10#define EARLY_CROSSOVER_FRACTION_FOR_NODE 0.80#define EARLY_MUTATION_FRACTION 0.00#define EARLY_COPY_FRACTION 0.10#define EARLY_BRANCH_CREATION_FRACTION 0.00#define EARLY_BRANCH_DUPLICATION_FRACTION 0.00#define EARLY_BRANCH_DELETION_FRACTION 0.00#define EARLY_ARG_DUPLICATION_FRACTION 0.00#define EARLY_ARG_DELETION_FRACTION 0.00#define GROWTH_METHOD 3#define LAST_EARLY_GEN 1/****************************************************************************//* PARALLELIZATION PARAMETERS */#define EXCHBUFSIZE 120/****************************************************************************//* SPECIFICATION OF FITNESS CASES */#define MAX_STRING_LENGTH 15typedef struct fit { int length; int string[MAX_STRING_LENGTH]; int valid; } FitCaseInfo;typedef struct g_data { int i; } GlobalFitCaseInfo;void PrintCases(void);int IsValid(int string[], int length);int Equal(int string1[], int string2[], int length);int Unique(int case_num);void Alternate(int case_num, int length);/*NOTE: These two structures must be defined, and their contents can be altered by the user, but the entirety of the fitness cases must fit into these structures in some fashion (ideally in a non dynamic manner!). The boss node and meshnode message passing processes would have to be modified to support other types of fitness cases*/ #define MAX_NUM_FIT_CASES 500#define NUM_OUT_SAMPLE_FIT_CASES 0#define PROBSEED 31726 /*Random Seed for fitness_case preparation*//****************************************************************************//* USER SECTION */#define NODES_PER_RPB 50#define NODES_PER_ADF 300#define ACTION_ACCEPT 1#define ACTION_REJECT 0#define ARC_A 0#define ARC_B 1#define TRUE 1#define FALSE 0#define MAX_NUM_STATES 600#define NUM_INPUTS 2#define STRACE 0#define STACK_SIZE 1000typedef struct state_info { int trans[NUM_INPUTS]; int action;} StateInfo;typedef struct table_type { StateInfo state[MAX_NUM_STATES]; int result;} TableType;/****************************************************************************//* GRAPHICAL / OUTPUT PARAMETERS*//* (Many of these are based on the max_num_fit_cases, above */#define NUM_PER_DOT 100 /*Number of iterations for each dot*/#define MAX_HITS 10 /*Same as above max num fit cases */#define NUM_BUCKETS 11 /*For the hits histogram*/#define GRAPHICAL_MAX_FITNESS 32.0#define TIME_FOR_STATUS_GOOD 600#define TIME_FOR_STATUS_SLOW 1200#define TIME_FOR_STATUS_DANGER 3600#define GRAPHICS_FILENAME "c:\\gridstat.sys"#define EOGS_PER_OUTPUT 10#define GRAPH_FITNESS_DELTA 1#define VB_UPDATE_RATE 8 /****************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -