📄 rtdmoea.cpp
字号:
// RTDMOEA.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "RTDMOEA.h"
#include "Examples.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// The one and only application object
CWinApp theApp;
int Transform(const char*);
void OutputUsage();
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
return nRetCode;
}
CExamples m_Example;
m_Example.StartTiming();
m_Example.MOP_IsOriginal=TRUE;
m_Example.MOP_isShowGenes=FALSE;
if (argc !=2)
{
OutputUsage();
return 1;
}
int number;
number = Transform(argv[1]);
switch (number)
{
//多目标
/************************************************************************/
/* RTCGPS Real Time Geometric Pareto Selection */
/************************************************************************/
// case 113: m_Example.RunRTCGPSKUR();
// break;
case 114: m_Example.RunRTCGPSFDA1();
break;
case 115: m_Example.RunRTCGPSFDA2();
break ;
case 116: m_Example.RunRTCGPSFDA3();
break;
case 117: m_Example.RunRTCGPSFDA4();
break ;
case 118: m_Example.RunRTCGPSFDA5();
break;
default:
m_Example.RunMOP(argv[1], number);
break;
}
m_Example.EndTiming();
m_Example.PrintTimeInfo();
return nRetCode;
}
void OutputUsage()
{
printf("Usage: MOP Parameter\n");
printf("Parameter would be CSRN and so on\n");
printf("RTCGPS 多目标\n");
printf("RTCKUR: m_Example.RunRTCGPSKUR()\n");
printf("RTCFDA1: m_Example.RunRTCGPSFDA1()\n");
printf("RTCFDA2: m_Example.RunRTCGPSFDA2()\n");
printf("RTCFDA3: m_Example.RunRTCGPSFDA3()\n");
printf("RTCFDA4: m_Example.RunRTCGPSFDA4()\n");
printf("RTCFDA5: m_Example.RunRTCGPSFDA5()\n");
};
int Transform(const char *tmp)
{
////DMOP
if (stricmp(tmp,"RTCGPSKUR")==0) return 113;
if (stricmp(tmp,"RTCGPSFDA1")==0) return 114;
if (stricmp(tmp,"RTCGPSFDA2")==0) return 115;
if (stricmp(tmp,"RTCGPSFDA3")==0) return 116;
if (stricmp(tmp,"RTCGPSFDA4")==0) return 117;
if (stricmp(tmp,"RTCGPSFDA5")==0) return 118;
////MOP
if (strcmp(tmp, "COMET") == 0) return 91;
if (strcmp(tmp, "ZDT4") == 0) return 14;
if (strcmp(tmp, "KURN") == 0) return 92;
if (strcmp(tmp, "KURS") == 0) return 93;
if (strcmp(tmp, "QV") == 0) return 94;
if (strcmp(tmp, "DTLZ1") == 0) return 21;
if (strcmp(tmp, "DTLZ2") == 0) return 22;
if (strcmp(tmp, "DTLZ3") == 0) return 23;
if (strcmp(tmp, "DTLZ4") == 0) return 24;
if (strcmp(tmp, "DTLZ5") == 0) return 25;
if (strcmp(tmp, "DTLZ6") == 0) return 26;
if (strcmp(tmp, "DTLZ7") == 0) return 27;
if (strcmp(tmp, "ZDT1") == 0) return 11;
if (strcmp(tmp, "ZDT2") == 0) return 12;
if (strcmp(tmp, "ZDT3") == 0) return 13;
if (strcmp(tmp, "ZDT6") == 0) return 16;
if (strcmp(tmp, "SPH3") == 0) return 95;
if (strcmp(tmp, "SPH2") == 0) return 96;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -