⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ga.h

📁 连轧过程控制仿真程序
💻 H
字号:
// GA.h: interface for the GA class.
//
//////////////////////////////////////////////////////////////////////

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#include "global.h"
#include "powermodel.h"
#include "pressmodel.h"
#include "slipmodel.h"
#include "speedmodel.h"
#include "torquemodel.h"

#include "de_dragmodel.h"
#define N 3  // number of variables
#define M 1  // number of objectives
#define TYPE -1 // 1=max;-1=min
#define GEN 500 // maximum generation number
#define POP_SIZE 30
#define P_MUTATION 0.05
#define P_CROSSOVER 0.1

#if !defined(AFX_GA_H__D6D67BD2_5B24_46A3_A56C_EA4EFD193040__INCLUDED_)
#define AFX_GA_H__D6D67BD2_5B24_46A3_A56C_EA4EFD193040__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000



class GA  
{
public:
	GA();
	virtual ~GA();
	
	double  OBJECTIVE[POP_SIZE+1][M+1];
	double  q[POP_SIZE+1];
	double *GA_1(global y);
protected:
	void  initialization(double H0,double h4,global y);
	void  evaluation(int gen,global y);
	void  selection(void);
	void  crossover(global y);
	void  crossover2(global y,int k);
	void  mutation(global y,double pp[POP_SIZE+1],int kk);
	void  objective_function(global y);
	double *cross_probability(int i);
	double *mutation_probability(int i);
	int   constraint_check(double x[],global y);
	double myu(double a, double b); // Uniform Distribution
	double  CHROMOSOME[POP_SIZE+1][N+1];

	

};

#endif // !defined(AFX_GA_H__D6D67BD2_5B24_46A3_A56C_EA4EFD193040__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -