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

📄 tsp5view.h

📁 Hopfiled 实现TSP旅行商问题 CH
💻 H
字号:
// tsp5View.h : interface of the CTsp5View class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_TSP5VIEW_H__0EA7A9DC_8222_49B9_990D_02A5A90633B6__INCLUDED_)
#define AFX_TSP5VIEW_H__0EA7A9DC_8222_49B9_990D_02A5A90633B6__INCLUDED_

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

#include<stdlib.h>
# include <stdio.h>
# include <math.h>
# include <ctype.h>
# include <time.h>
# define N 10
# define NN N*N
# define G(x) ((1.0+ tanh(x/u0))/2.0) 
#define  A    0.5
#define  B    0.5
#define  C    0.2
#define  D    0.5
#define  u0   0.02
#define  sub  0.00001
#define  h    0.01
#define  pi   3.1415926
#define  m    15




class CTsp5View : public CView
{
protected: // create from serialization only
	CTsp5View();
	DECLARE_DYNCREATE(CTsp5View)

// Attributes
public:
	CTsp5Doc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTsp5View)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	double c[N][2];
	void draw();
	void display();
	void sinit();
	void scities();
	int check();
	double e,f;
	int tm,aa;
	double dis;
	double v[NN];
	double t[NN];
	double l[NN];
	double dd[NN];
	double  xx[N],yy[N];
	double u[NN];
	double v1[14000];
	void energy();

	FILE *fp;//,*fopen();
	virtual ~CTsp5View();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CTsp5View)
	afx_msg void OnTsp();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in tsp5View.cpp
inline CTsp5Doc* CTsp5View::GetDocument()
   { return (CTsp5Doc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_TSP5VIEW_H__0EA7A9DC_8222_49B9_990D_02A5A90633B6__INCLUDED_)

⌨️ 快捷键说明

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