资源简介
采用排挤机制的小生境遗传算法仿真程序(MATLAB仿真)
代码片段和文件信息
%小生境遗传算法主程序
function f=NicheSGA_1;
%Optimizationstyle=‘Min‘;VarietyNumber=1;Xmin=[0];Xmax=[10*pi];PopulationSize=100;GenotypeLength=20;MaxGeneration=100;L=5;
Optimizationstyle=‘Max‘;VarietyNumber=1;Xmin=[0];Xmax=[1];PopulationSize=100;GenotypeLength=20;MaxGeneration=100;L=0.18;
Pc=0.9;Pm=0.01;N=PopulationSize/2;Penalty=10^(-30);
initpop=randint(PopulationSizeVarietyNumber*GenotypeLength+VarietyNumber+2);
oldpop=decode(OptimizationstyleVarietyNumberPopulationSizeXminXmaxGenotypeLengthinitpop);
[Bindex]=sort(oldpop(:VarietyNumber*GenotypeLength+VarietyNumber+2));
oldpop=[oldpop(index(:):)];
temp1=oldpop(PopulationSize-N+1:PopulationSize:);
k=1;
while k<=MaxGeneration
newpop=selection(VarietyNumberPopulationSizeGenotypeLengtholdpop);
randorder=randperm(PopulationSize);
for i=1:2:(PopulationSize-1)
parent1=newpop(randorder(i):);
parent2=newpop(randorder(i+1):);
[child1child2]=crossover(VarietyNumberGenotypeLengthparent1parent2Pc);
newpop(randorder(i):)=child1;
newpop(randorder(i+1):)=child2;
end
for i=1:PopulationSize
newpop(i:)=mutation(VarietyNumberGenotypeLengthPmnewpop(i:));
end
newpop=decode(OptimizationstyleVarietyNumberPopulationSizeXminXmaxGenotypeLengthnewpop);
faveragevalue(k)=mean(newpop(:VarietyNumber*GenotypeLength+VarietyNumber+1));
if (Optimizationstyle==‘Max‘)
optimization(kVarietyNumber+1)=max(newpop(:VarietyNumber*GenotypeLength+VarietyNumber+1));
else
optimization(kVarietyNumber+1)=min(newpop(:VarietyNumber*GenotypeLength+VarietyNumber+1));
end
[tfindex]=ismember(optimization(kVarietyNumber+1)newpop(:VarietyNumber*GenotypeLength+VarietyNumber+1));
optimization(k1:VarietyNumber)=newpop(indexVarietyNumber*GenotypeLength+1:VarietyNumber*GenotypeLength+VarietyNumber);
temp2=[temp1‘ newpop‘]‘;
temp2=niche(PopulationSizeVarietyNumberGenotypeLengthNLPenaltytemp2);
[Bindex]=sort(temp2(:VarietyNumber*GenotypeLength+VarietyNumber+2));
temp2=[temp2(index(:):)];
temp1=temp2(PopulationSize+1:PopulationSize+N:);
oldpop=temp2(N+1:PopulationSize+N:);
k=k+1;
end
if (Optimizationstyle==‘Max‘)
optimizationf=max(optimization(:VarietyNumber+1))
else
optimizationf=min(optimization(:VarietyNumber+1))
end
[tfindex]=ismember(optimizationfoptimi
相关资源
- 3-SPR并联平台Matlab运动学正解及工作空
- 《现代数字信号处理》何子述 第三章
- CNN深度学习识别字符matlab
- 车牌识别matlab代码
- 粒子群算法优化RBF神经网络
- QPSK的MATLAB仿真程序
- 复杂网络matlab经典算法
- Maple Toolbox for MATLAB 工具箱使用介绍
- 非局部均值 图像去噪(matlab)
- 循环自相关函数matlab程序
- matlab一元线性回归
- 基于DVB-T标准的OFDM调制技术的MATLAB源
- Alamouti方案的matlab仿真
- 用MATLAB编写的svm源程序,可以实现支
- MATLAB绘制威布尔分布曲线.docx
- 故障树的MATLAB程序。
- 基于基于遗传算法matlab优化程序
- matlab ar模型卡尔曼滤波代码
- NSGA2-matlaB
-
buck-boost的simuli
nk电路仿真图 - 粒子群 matlab简单优化过的 TSP
- Matlab增量式PID算法仿真
- matlab 数据处理 求绝对误差 剔除粗
- 基于MATLAB的基带传输位同步信号提取
- 基于MATLAB的图像分割含GUI界面
- matlab写的GMM代码
- MATLAB ADOV 路由仿真代码
- turbo码的matlab仿真
- 基于BP神经网络的PID控制器的Matlab仿真
- matlab逻辑回归应用代码十分详细附数
评论
共有 条评论