資源簡介
智能控制第三版仿真程序.rar

代碼片段和文件信息
%Generic?Algorithm?for?function?f(x1x2)?optimum
clear?all;
close?all;
%Parameters
Size=80;???
G=100;?????
CodeL=10;
?
umax=2.048;
umin=-2.048;
E=round(rand(Size2*CodeL));????%Initial?Code
%Main?Program
for?k=1:1:G
time(k)=k;
for?s=1:1:Size
m=E(s:);
y1=0;y2=0;
%Uncoding
m1=m(1:1:CodeL);
for?i=1:1:CodeL
???y1=y1+m1(i)*2^(i-1);
end
x1=(umax-umin)*y1/1023+umin;
m2=m(CodeL+1:1:2*CodeL);
for?i=1:1:CodeL
???y2=y2+m2(i)*2^(i-1);
end
x2=(umax-umin)*y2/1023+umin;
F(s)=100*(x1^2-x2)^2+(1-x1)^2;
end
Ji=1./F;
%******?Step?1?:?Evaluate?BestJ?******
BestJ(k)=min(Ji);
fi=F;??????????????????????????%Fitness?Function
[OderfiIndexfi]=sort(fi);?????%Arranging?fi?small?to?bigger
Bestfi=Oderfi(Size);???????????%Let?Bestfi=max(fi)
BestS=E(Indexfi(Size):);??????%Let?BestS=E(m)?m?is?the?Indexfi?belong?to?max(fi)
bfi(k)=Bestfi;
%******?Step?2?:?Select?and?Reproduct?Operation******
???fi_sum=sum(fi);
???fi_Size=(Oderfi/fi_sum)*Size;
???
???fi_S=floor(fi_Size);????????%Selecting?Bigger?fi?value
???
???kk=1;
???for?i=1:1:Size
??????for?j=1:1:fi_S(i)????????%Select?and?Reproduce?
???????TempE(kk:)=E(Indexfi(i):);??
?????????kk=kk+1;??????????????%kk?is?used?to?reproduce
??????end
???end
???
%************?Step?3?:?Crossover?Operation?************
pc=0.60;
n=ceil(20*rand);
for?i=1:2:(Size-1)
????temp=rand;
????if?pc>temp??????????????????%Crossover?Condition
????for?j=n:1:20
????????TempE(ij)=E(i+1j);
????????TempE(i+1j)=E(ij);
????end
????end
end
TempE(Size:)=BestS;
E=TempE;
???
%************?Step?4:?Mutation?Operation?**************
%pm=0.001;
%pm=0.001-[1:1:Size]*(0.001)/Size;?%Bigger?fi?smaller?Pm
%pm=0.0;????%No?mutation
pm=0.1;?????%Big?mutation
???for?i=1:1:Size
??????for?j=1:1:2*CodeL
?????????temp=rand;
?????????if?pm>temp????????????????%Mutation?Condition
????????????if?TempE(ij)==0
???????????????TempE(ij)=1;
????????????else
???????????????TempE(ij)=0;
????????????end
????????end
??????end
???end
???
%Guarantee?TempPop(30:)?is?the?code?belong?to?the?best?individual(max(fi))
TempE(Size:)=BestS;
E=TempE;
end
?
Max_Value=Bestfi
BestS
x1
x2
figure(1);
plot(timeBestJ);?
xlabel(‘Times‘);ylabel(‘Best?J‘);
figure(2);
plot(timebfi);
xlabel(‘times‘);ylabel(‘Best?F‘);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2317??2004-12-31?22:55??智能控制第三版仿真程序-網站下載\chap10\chap10_1.m
?????文件???????2554??2004-12-31?22:57??智能控制第三版仿真程序-網站下載\chap10\chap10_2.m
?????文件???????2397??2005-01-21?22:43??智能控制第三版仿真程序-網站下載\chap10\chap10_3a.m
?????文件????????956??2005-01-17?09:36??智能控制第三版仿真程序-網站下載\chap10\chap10_3b.m
?????文件???????1067??2005-01-21?22:43??智能控制第三版仿真程序-網站下載\chap10\chap10_3c.m
?????文件???????1956??2013-10-02?16:54??智能控制第三版仿真程序-網站下載\chap10\chap10_4.m
?????文件???????1950??2013-10-02?16:55??智能控制第三版仿真程序-網站下載\chap10\chap10_4cross.m
?????文件????????266??2008-09-20?17:04??智能控制第三版仿真程序-網站下載\chap10\chap10_4dis.m
?????文件????????590??2013-10-02?16:55??智能控制第三版仿真程序-網站下載\chap10\chap10_4mutate.m
?????文件????????481??2008-09-24?10:30??智能控制第三版仿真程序-網站下載\chap10\chap10_4select.m
?????文件???????1892??2013-09-30?12:58??智能控制第三版仿真程序-網站下載\chap10\chap10_5.m
?????文件?????????86??2012-10-08?08:12??智能控制第三版仿真程序-網站下載\chap10\chap10_5obj.m
?????文件????????345??2012-10-08?12:00??智能控制第三版仿真程序-網站下載\chap10\chap10_6.m
?????文件???????1994??2013-09-30?13:01??智能控制第三版仿真程序-網站下載\chap10\chap10_7.m
?????文件????????471??2012-09-13?10:43??智能控制第三版仿真程序-網站下載\chap10\chap10_7obj.m
?????文件????????147??2008-09-20?10:19??智能控制第三版仿真程序-網站下載\chap10\city15.txt
?????文件????????202??2008-09-19?21:47??智能控制第三版仿真程序-網站下載\chap10\city20.txt
?????文件????????204??2008-09-23?15:25??智能控制第三版仿真程序-網站下載\chap10\city30.txt
?????文件?????????73??2008-09-19?22:13??智能控制第三版仿真程序-網站下載\chap10\city8.txt
?????文件????????710??2013-10-31?15:02??智能控制第三版仿真程序-網站下載\chap10\de1_file.mat
?????文件????????381??2012-09-05?10:46??智能控制第三版仿真程序-網站下載\chap10\function_plot.m
?????文件????????276??2013-10-31?14:58??智能控制第三版仿真程序-網站下載\chap10\pfile.mat
?????文件????????961??2008-07-31?19:35??智能控制第三版仿真程序-網站下載\chap11\chap11_1ctrl.m
?????文件????????651??2008-07-31?19:36??智能控制第三版仿真程序-網站下載\chap11\chap11_1input.m
?????文件???????1211??2008-07-31?19:31??智能控制第三版仿真程序-網站下載\chap11\chap11_1main.m
?????文件???????1354??2008-08-01?11:32??智能控制第三版仿真程序-網站下載\chap11\chap11_1plant.m
?????文件??????13735??2008-08-01?12:29??智能控制第三版仿真程序-網站下載\chap11\chap11_1sim.mdl
?????文件????????740??2008-07-31?20:01??智能控制第三版仿真程序-網站下載\chap11\chap11_2ctrl.m
?????文件????????651??2008-07-31?20:01??智能控制第三版仿真程序-網站下載\chap11\chap11_2input.m
?????文件???????1434??2008-07-31?19:55??智能控制第三版仿真程序-網站下載\chap11\chap11_2main.m
............此處省略118個文件信息
- 上一篇:cygwin離線安裝包地址
- 下一篇:Pointofix.rar
評論
共有 條評論