📄 mutate3.cpp
字号:
// Mutate3.cpp: implementation of the Mutate3 class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Mutate3.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Mutate3::Mutate3(double p,int d):Mutate(p,d)
{
}
void Mutate3::Mutation(Popular * pop,Rand * r)
{
if(r->random(1)<pm)
{
double * pp=pop->GetPop();
int mm=r->randint(dimension);
int nn=r->randint(dimension);
int temp=pp[mm];
pp[mm]=pp[nn];
pp[nn]=temp;
pop->SetPop(pp);
delete[] pp;
}
}
Mutate3::~Mutate3()
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -