📄 evaluationtsp.cpp
字号:
// EvaluationTSP.cpp: implementation of the EvaluationTSP class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "EvaluationTSP.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
EvaluationTSP::EvaluationTSP(int s)
{
scale=s;
}
void EvaluationTSP::SetOptim(ParticleTSP * * sworm,int * gb)
{
double temp;
double p=sworm[*gb]->GetOS();
for(int j=0;j<scale;j++)
{
if(sworm[j]->GetSolution()>sworm[j]->GetOS())
{
sworm[j]->SetIO();
}
temp=sworm[j]->GetOS();
if(temp>p)
{
p=temp;
*gb=j;
}
}
}
EvaluationTSP::~EvaluationTSP()
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -