scs2.h
来自「机器学习中一个重要的方法——概念学习系统。」· C头文件 代码 · 共 28 行
H
28 行
const int MAXLEN = 60;
const int MAXCHROM = 100;
const float MAXFITNESS = 0.85;
enum tagboolean {F = 0,T =1};
typedef enum tagboolean Allele;
typedef enum tagboolean Boolean;
typedef struct {
int Rulenum;
Allele String[MAXLEN];
float Fitness;
int Parent1,Parent2;
}Chromosome;
void initdata(void);
void checkvaild(Chromosome*checkchrom,int index);
void extractstr(char *str,int curbit,int length,int index);
void report(void);
void statistics(Chromosome *pop);
int select(void);
Allele mutation (Allele alleleval);
void crossover(int parent1,int parent2,int child);
void objfunc(Chromosome *pop);
void replace(void);
void generation(void);
inline float random01(void);
float rnd(int low,int high);
Boolean flip(float val);
void reportgraph(char *,int);
void initcoords(int);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?