gene.h

来自「Genetic Algorithm (GA) based solver for 」· C头文件 代码 · 共 57 行

H
57
字号
// gene.h// Declaration of class Gene// Thomas Pederson, 950505#ifndef GENE#define GENE#include "global.h"#include <iostream.h>class Gene{   public:   Gene(char *_name, coord_t _x, coord_t _y,	unsigned int _index, unsigned int _distVecLength);   ~Gene();      // Calculates Eucledian distance between this gene and _gene and returns the value.   distance_t calculateDistanceTo(Gene& _gene);   // Returns Eucledian distance between this gene and _gene.   distance_t distanceTo(Gene& _gene);   // Returns this gene's index in original chromosome pool.   unsigned int getIndex() {return index;}   // Returns this gene's name.   char *getName() {return name;}   // Prints gene information to stream.   friend ostream& operator<<(ostream& outStr, Gene& gene);      private:   distance_t *distance; // distance vector   unsigned int distVecLength; // length of distance vector   char *name; // name of gene   coord_t x,y; // gene's coordinates   unsigned int index; // gene's index};#endif

⌨️ 快捷键说明

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