item.h

来自「用遗传算法实现巡回旅行商(邮差问题)的程序。可自由设置城市位置及数目」· C头文件 代码 · 共 24 行

H
24
字号
// item.h: interface for the item class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_ITEM_H__5831BE0C_4F97_4132_9D8B_B1E1CBEF80DE__INCLUDED_)
#define AFX_ITEM_H__5831BE0C_4F97_4132_9D8B_B1E1CBEF80DE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class item  
{
public:
	item();
	virtual ~item();
	int flip(double );//返回值为1的概率为rate.
	double random();   //0-1 random number	
	void setbit(unsigned long *,int,int);//set bit as value.
	int getbit(unsigned long *,int );//get the value of bit.
};

#endif // !defined(AFX_ITEM_H__5831BE0C_4F97_4132_9D8B_B1E1CBEF80DE__INCLUDED_)

⌨️ 快捷键说明

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