?? yichuansuanfa.h
字號:
// YIchuansuanfa.h: interface for the YIchuansuanfa class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_YICHUANSUANFA_H__5EC8E48F_0B4E_4548_8A5A_F50BCB371440__INCLUDED_)
#define AFX_YICHUANSUANFA_H__5EC8E48F_0B4E_4548_8A5A_F50BCB371440__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Cluster.h"
class YIchuansuanfa : public CCluster
{
public:
YIchuansuanfa();
virtual ~YIchuansuanfa();
int FunctionMode;
int CHROMLENGTH;
int PopSize;
int MaxGeneration;
double Pc;//交叉概率
double Pm;//變異概率
struct individual
{
int chrom[50];
double value;
double fitness;
int index;
};
int index;//最優解出現的最小代數
int generation;
int best_index;
int worst_index;
struct individual bestindividual;//最優個體
struct individual worstindividual;//最差個體
struct individual currentbest;//當前的最優個體
struct individual population[80];
void GenerationInitialPopulation();
void GenerateNextPopulation();//繁殖下一個體
void EvaluatePopulation();//評估人群
void CalculateObjectValue();//計算物體價值
void CalculateFitnessValue();//計算適應性
void FindBestAndWorstIndividual();
void PerformEvolution();//開始演變
void SelectionOperator();
void CrossoverOperator();
void MutationOperator();
void OutputTextReport();
void main();
};
#endif // !defined(AFX_YICHUANSUANFA_H__5EC8E48F_0B4E_4548_8A5A_F50BCB371440__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -