多目标规划遗传算法

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

hing at a time and All things in their being are good for somethin
plot(trace1(:,2),'.'); grid; legend('解的变化','种群均值的变化'); xlabel('迭代次数'); ylabel('目标函数值'); figure(2); clf; plot(trace2(:,1)); hold on; plot(trace2(:,2),'-.'); plot(trace2(:,1),'.'); plot(trace2(:,2),'.'); grid; legend('解的变化','种群均值的变化'); xlabel('迭代次数'); ylabel('目标函数值'); figure(3); clf; plot(trace3(:,1)); hold on; plot(trace3(:,2),'-.'); plot(trace3(:,1),'.'); plot(trace3(:,2),'.'); grid; legend('解的变化','种群均值的变化'); xlabel('迭代次数'); ylabel('目标函数值'); figure(4); clf; plot(f1(v)); hold on; plot(f2(v),'r-.'); grid;
hing at a time and All things in their being are good for somethin
%遗传算法解决多目标函数规划 clear clc syms x; %Function f1=f(x) f1=x(:,1).*x(:,1)/4+x(:,2).*x(:,2)/4; %function f2=f(x) f2=x(:,1).*(1-x(:,2))+10; NIND=100; MAXGEN=50; NVAR=2; PRECI=20; GGPA=0.9; trace1=[]; trace2=[]; trace3=[]; FielD=[rep([PRECI],[1,NVAR]);[1,1;4,2];rep([1;0;1;1],[NVAR])]; Chrom=crtbp(NIND,NVAR*PRECI); v=bs2rv(Chrom,FielD); gen=1; while gen<MAXGEN,
ቤተ መጻሕፍቲ ባይዱ
[NIND,N]=size(Chrom); M=fix(NIND/2); ObjV1=f1(v(1:M,:)); FitnV1=ranking(ObjV1); SelCh1=select('sus',Chrom((M+1):NIND,:),FintV2,GGAP); SelCh=[SelCh1;SelCh2]; SelCh=recombin('xovsp',SelCh,0.7); Chrom=mut(SelCh); v=bs2rv(Chrom,FielD); trace1(gen,1)=min(f1(v)); trace1(gen,2)=sum(f1(v))/length(f1(v)); trace2(gen,1)=min(f2(v)); trace2(gen,2)=sum(f2(v))/length(f2(v)); trace3(gen,1)=min(f1(v)+f2(v)); trace3(gen,2)=sum(f1(v))/length(f1(v))+sum(f2(v))/length(f2(v)); gen=gen+1; end figure(1); clf; plot(trace1(:,1)); hold on; plot(trace1(:,2),'-.'); plot(trace1(:,1),'.');
相关文档
最新文档