parameter.hpp
来自「这是遗传算法的源代码」· HPP 代码 · 共 50 行
HPP
50 行
// -*- c++ -*-//// File: parameter.hpp//// Description: definition of parameters for the ECGA.//// Author: Fernando Lobo//// Date: June/1999//// Extended to deal with chi-ary problems by Luis de la Ossa// GCC 3.4 and 4 series compliance by Kumara Sastry //// Date: March/2006#ifndef _parameter_hpp#define _parameter_hppclass parameter { public: static double seed; // seed for random number generator static int lchrom; // chromosome length static int popsize; // population size static double pcross; // probability of crossover static int tournament_size; // tournament size static int stop_criteria; // stopping criteria for the algorithm static double stop_criteria_arg; // stop criteria argument (ex: maxgens= x) static bool learn_MPM; // on = learns linkage, off = compact GA static int *ranges; // range of values that can take each gene static bool report_pop; static bool report_string; static bool report_fitness; static bool report_MPM;};//// constant definitions for stopping criterias//const int ALLELE_CONVERGENCE = 60;const int MAX_GENERATIONS = 61;#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?