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

📄 ant_testdlg.h

📁 蚁群算法的程序
💻 H
字号:
// ant_testDlg.h : header file
//

#if !defined(AFX_ANT_TESTDLG_H__F6D10F0F_1CBA_4355_93CE_CD1CCE819285__INCLUDED_)
#define AFX_ANT_TESTDLG_H__F6D10F0F_1CBA_4355_93CE_CD1CCE819285__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CAnt_testDlg dialog

class CAnt_testDlg : public CDialog
{
// Construction
public:
	float alpha, rho, p0;
	//float tau_min, tau_max;
	float tau0;
	int dimension;
	int *gbant;				//global best ant
	float gbfit;			//global best fit
	float gby;				//global best y
	int num_layers;			//number of layers
	int num_ants;			//number of ants
	int num_iters;			//maximum number of iterations
	void Onrun() ;
/*	void outputtextreport();
	void evaluate();
	void decode();
	void global_update();
	void get_best_ant();
	void local_update(int ant_no, int layer);
	void ant_move(int ant_no, int layer);
	void init_vars();
	void allocate_vars();
	void release_vars();*/
	CAnt_testDlg(CWnd* pParent = NULL);	// standard constructor
	void allocate_vars();	//allocate memory for variables
	void release_vars();	//release memory allocated for variables

	void init_vars();		//initialize variables used in searching process
	void ant_move(int ant_no, int layer);
							//the ant_no-th ant chooses an node in the layer-th layer
	void local_update(int ant_no, int layer);
							//the arguments are similar to function ant_move
	void get_best_ant();	//find out the best ant of current iteration and update the global best ant
	void global_update();

	virtual void evaluate();
	virtual void decode();

//	CAcs4Fun();
//	~CAcs4Fun();				//call release_vars


// Dialog Data
	//{{AFX_DATA(CAnt_testDlg)
	enum { IDD = IDD_ANT_TEST_DIALOG };
	int		m_edit2;
	int		m_edit3;
	double	m_edit4;
	double	m_edit5;
	double	m_edit6;
	double	m_edit7;
	int		m_edit8;
	double	m_edit9;
	double	m_edit10;
	int		m_edit11;
	int		m_edit12;
	double	m_edit13;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CAnt_testDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;
	float ***tau;
	int **ant;
	float *fit;
	float *y;
	float **x;				//x[i][j] stands for the j-th dimension of the variant decoded from the i-th ant
	int *ibant;				//iteration best ant
	int ibant_no;			//NO. of iteration best ant
	float ibfit;			//iteration best fit
	float iby;				//iteration best y
	int cur_iter;			//current iteration

	bool need_release;		//memory has been allocated
	int layers_per_dimension;		//number of layers to represent one dimension of the variants

	// Generated message map functions
	//{{AFX_MSG(CAnt_testDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void Onend();
	afx_msg void OnCancelMode();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnShow();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_ANT_TESTDLG_H__F6D10F0F_1CBA_4355_93CE_CD1CCE819285__INCLUDED_)

⌨️ 快捷键说明

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