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

📄 gayhdlg.h

📁 这是个关于基于遗传算法的Schaffer F6函数优化的程序代码。
💻 H
字号:
// GAyhDlg.h : header file
//

#if !defined(AFX_GAYHDLG_H__D69F8F6C_858E_420D_A0DF_D3DDA93AB646__INCLUDED_)
#define AFX_GAYHDLG_H__D69F8F6C_858E_420D_A0DF_D3DDA93AB646__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "head.h"
/////////////////////////////////////////////////////////////////////////////
// CGAyhDlg dialog

class CGAyhDlg : public CDialog
{
// Construction
public:
	double ylast;
	double xlast;
	void InsertItems();
	int generation;
	void report();
	void mutate();
	void swap(double *x, double *y);
	void Xover(int one, int two);
	void across();
	void select();
	void elitist();
	int cur_best;
	void keep_the_best();
	void evaluate();
	double randval(double low, double high);
	void initialize();
	CGAyhDlg(CWnd* pParent = NULL);	// standard constructor   
    genotype *population;    /* population */
    genotype *newpopulation; /* new population; */
	Data* data;
// Dialog Data
	//{{AFX_DATA(CGAyhDlg)
	enum { IDD = IDD_GAYH_DIALOG };
	CListCtrl	m_show;
	double	m_pc;
	double	m_pm;
	int		m_maxgeneration;
	int		m_size;
	double	m_fxy;
	double	m_x;
	double	m_y;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;
    genotype* newsize();
	// Generated message map functions
	//{{AFX_MSG(CGAyhDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnYhrun();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_GAYHDLG_H__D69F8F6C_858E_420D_A0DF_D3DDA93AB646__INCLUDED_)

⌨️ 快捷键说明

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