classfile.h

来自「一个遗传算法(GA)的实现。command line 的结构。输入输出格式请见命」· C头文件 代码 · 共 32 行

H
32
字号
//------------------------------------------------------------
// classfile.h
#ifndef _CLASSFILE
#define _CLASSFILE

class individual
{
public:
    unsigned *chrom;                  /* chromosome string for the individual */
    double   fitness;                            /* fitness of the individual */
    int      xsite;                               /* crossover site at mating */
    int      parent[2];                  /* who the parents of offspring were */
    int      *utility;           /* utility field can be used as pointer to a */
                /* dynamically allocated, application-specific data structure */
    int      generation;                      /* generation which produced it */
public:
	individual();
	virtual ~individual();
};

class bestever
{
public:
    unsigned *chrom;        // chromosome string for the best-ever individual 
    double   fitness;                  // fitness of the best-ever individual 
    int      generation;                      // generation which produced it 
public:
	bestever();
	virtual ~bestever();
};

#endif

⌨️ 快捷键说明

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