📄 dpso.h
字号:
// DPSO.h: interface for the DPSO class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DPSO_H__A7F9CA4A_C184_4A9C_82C2_95A81E4D77E3__INCLUDED_)
#define AFX_DPSO_H__A7F9CA4A_C184_4A9C_82C2_95A81E4D77E3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "DPARTICLE.h"
class DPSO
{
protected:
DPARTICLE *dParticle;
int PNum;
int GBestIndex;
double W;
double C1;
double C2;
int city_car[100];
void Initialize();
void CalFit();
void CalCity_car(int* city_root,int dim);
virtual void ParticleFly();
public:
DPSO();
DPSO(int dim, int num, int* city_root);
~DPSO();
void SetW(double w){W=w;};
void SetC1(double c){C1=c;};
void SetC2(double c){C2=c;};
virtual double GetFit(DPARTICLE&)=0;
Run(int max);
double GetBest();
int GetGBestIndex();
int GetGXBest(int k);
};
#endif // !defined(AFX_DPSO_H__A7F9CA4A_C184_4A9C_82C2_95A81E4D77E3__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -