⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 item.h

📁 用遗传算法实现巡回旅行商(邮差问题)的程序。可自由设置城市位置及数目
💻 H
字号:
// 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -