资源简介
文中对GPED 有关的定义和性质作了详细地阐述,并通过实验对GPED 和基本GEP 解码方法进行了对比研究。最后,基于GPED,并从初始群体生成、选择策略、遗传算子等方面对GEP 作了改进,提出了一种新的算法GPEP,并将其应用于碎石桩复合地基承载力预测。结果表明GPEP 算法在预测精度和演化效率上都超过遗传神经网络、GP 等方法。

代码片段和文件信息
// Gene.cpp: implementation of the Gene class.
//
//////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “Gene.h“
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Gene::Gene()
{
}
Gene::~Gene()
{
}
void Gene::baseSetting(int gn int hl)
{
geneNum = gn;
headLen = hl;
functiontypeLen = sizeof(functiontype)/sizeof(char) - 1;
//printf(“ %d“ functiontypeLen);
tailtypeLen = sizeof(tailtype)/sizeof(char) - 1;
//printf(“ %d“ tailtypeLen);
tailLen = headLen + 1;
geneLen = headLen + tailLen;
gene = new char[geneLen];
}
void Gene::Initial()
{
int i;
srand((unsigned)time(NULL));
for(i = 0; i < geneLen; i++)
{
if(i < headLen){
gene[i] = functiontype[rand()%(functiontypeLen)];
}
else{
gene[i] = tailtype[rand()%(tailtypeLen)];
}
}
//output the initialization gene
cout<<“initial:“;
for(i = 0; i < geneLen; i++)
{
cout< }
cout<
}
void Gene::geneDecode()
{
int nCount = 1;
for(int i =0; i < geneLen && nCount != 0; i++){//complete scaning
if(gene[i] == ‘+‘ ||gene[i] == ‘-‘ ||gene[i] == ‘*‘ ||gene[i] == ‘/‘)nCount +=1;
else if(gene[i] == ‘Q‘ ||gene[i] == ‘S‘ ||gene[i] == ‘C‘ ||gene[i] == ‘T‘
||gene[i] == ‘L‘ ||gene[i] == ‘E‘ ||gene[i] == ‘~‘)nCount +=0;
else if(gene[i] == ‘a‘ ||gene[i] == ‘b‘ ||gene[i] == ‘c‘ ||gene[i] == ‘d‘||gene[i] == ‘e‘)
nCount += -1;
}
geneLenUse = i; //get the useful gene
}
void Gene::Result(const double Dc[]const double *tenvary)
{
double temp;
char string[35];
double number[34];
int iflagpositionbegin; //begin为Dc[]的下标指针
int outlength = 0;
char *output = new char[geneLenUse];
for(i = geneLenUse - 1; i >=0; i--){
output[geneLenUse - 1 - i] = gene[i];
}
outlength = geneLenUse;
output[outlength] = ‘\0‘;
cout<<“useful Length = “< cout<<“decode :“;
for(i = 0; i < outlength; i++){
cout< }
cout<
i = 0;
flag=0;
position=0;
begin=0;
while(output[position]!=‘\0‘&&output[position]!=‘\n‘&&position string[flag]=output[position];
if(string[flag]==‘a‘||string[flag]==‘b‘||string[flag]==‘c‘||string[flag]==‘d‘||string[flag]==‘e‘||string[flag]==‘f‘)
{
if(string[flag]==‘a‘){
number[flag]=tenvary[0];
flag++;
position++;
}
else if(string[flag]==‘b‘){
number[flag]=tenvary[1];
flag++;
position++;
}
else if(string[flag]==‘c‘){
number[flag]=tenvary[2];
flag++;
position++;
}
else if(string[flag]==‘d‘){
number[flag]=tenvary[3];
flag++;
position++;
}
else if(string[flag]==‘e‘){
number[flag]=tenvary[4];
flag++;
position++;
}
else if(string[flag]==‘f‘){
number[flag]=tenvary[5];
flag++;
position++;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 19930 2009-09-12 09:31 PGEP\Debug\Gene.obj
文件 0 2009-09-12 09:31 PGEP\Debug\Gene.sbr
文件 164864 2009-09-12 09:31 PGEP\Debug\PGEP.bsc
文件 253991 2009-09-12 09:31 PGEP\Debug\PGEP.exe
文件 341960 2009-09-12 09:31 PGEP\Debug\PGEP.ilk
文件 3536 2009-09-12 09:31 PGEP\Debug\PGEP.obj
文件 370840 2009-09-12 09:31 PGEP\Debug\PGEP.pch
文件 607232 2009-09-12 09:31 PGEP\Debug\PGEP.pdb
文件 0 2009-09-12 09:31 PGEP\Debug\PGEP.sbr
文件 2994 2009-09-12 09:31 PGEP\Debug\PGEPClass.obj
文件 0 2009-09-12 09:31 PGEP\Debug\PGEPClass.sbr
文件 2199 2009-09-12 09:31 PGEP\Debug\StdAfx.obj
文件 27711 2009-09-12 09:31 PGEP\Debug\StdAfx.sbr
文件 58368 2009-09-12 09:31 PGEP\Debug\vc60.idb
文件 69632 2009-09-12 09:31 PGEP\Debug\vc60.pdb
文件 5461 2009-09-12 09:27 PGEP\Gene.cpp
文件 922 2009-09-12 09:27 PGEP\Gene.h
文件 398 2009-10-10 15:45 PGEP\PGEP.cpp
文件 4760 2009-10-10 15:52 PGEP\PGEP.dsp
文件 533 2009-10-10 14:07 PGEP\PGEP.dsw
文件 66560 2009-09-12 09:31 PGEP\PGEP.ncb
文件 59904 2009-09-12 09:17 PGEP\PGEP.opt
文件 0 2009-09-12 09:31 PGEP\PGEP.plg
文件 425 2009-10-10 14:09 PGEP\PGEPClass.cpp
文件 528 2009-10-10 14:09 PGEP\PGEPClass.h
文件 1196 2009-10-10 14:07 PGEP\ReadMe.txt
文件 291 2009-10-10 15:55 PGEP\StdAfx.cpp
文件 880 2009-10-10 15:56 PGEP\StdAfx.h
目录 0 2009-10-13 12:52 PGEP\Debug
目录 0 2009-10-13 12:52 PGEP
............此处省略4个文件信息
相关资源
- VisualStudioUninstaller vs卸载工具
- 2017款解码软件v1.0.0.6
- 组态王驱动开发包3.0.0.7(中文)
- 多窗口后台鼠标连点器
- 使用选择性重传协议实现UDP可靠通信
- VC 获得文件属性 获取文件的创建时
- 一种红外遥控编解码仿真
- 读者写者问题(读者优先,写者优先
- 用VC 编写的仿QQ聊天室程序源代码
- 外点法程序
- 外罚函数程序
- qt-电子点菜系统
- 推箱子及人工智能寻路C 源代码
- 自己写的航空订票系统c 版--数据结构
- 数据结构实验魔王语言
- MUSIC算法c 实现
- C 餐厅叫号系统(QT平)
- 国际象棋c 完整版
- 曼彻斯特编解码_同步QuartusII工程
-
ob
jectARX给Auto CAD加工具条 - 画图程序MFC/VC/VC CRectTracker 串行化
- MFC网络编程实例
- L-Z编码L-Z解码
- c 课程设计 职工信息管理系统
- VC 游戏编程—附源代码
- IpHlpApi.h&IpHlpApi.lib
- 清华大学 c 郑莉 ppt课件
- c 程序判断离散数学中命题公式
- 多项式求和(数据结构C 版)
- vc 6.0开发的流程图编辑器
评论
共有 条评论