SGA2[1].0
所属分类:matlab编程
开发工具:matlab
文件大小:9KB
下载次数:123
上传日期:2007-10-15 21:15:32
上 传 者:
deedee628
说明: GA(Simple Genetic Algorithm)是一种强大的智能多变量优化算法,它模仿种群繁殖规律来进行优化。
本SGA可以优化变量,求最小值,最大值(当把函数倒数也就求最小值啦)
并且支持浮点编码,grey编码,二进制编码;轮赌法选择,锦标赛选择;单点交叉,均布交叉,浮点交叉;单点变异,浮点变异;
(GA (Simple Genetic Algorithm) is a powerful, intelligent multi-variable optimization algorithms, which mimic the breeding populations of the law to be optimized. SGA can optimize this variable, and the minimum value, maximum value (when the function of the countdown you will seek the minimum value) and to support the floating-point encoding, grey code, binary code round of gambling options, tournament selection single-point crossover, uniform Cross, floating-point crossover single point mutation, floating-point variation )
文件列表:
SGA2.0\AimFcn.m (644, 2004-06-10)
SGA2.0\Code.m (887, 2003-11-06)
SGA2.0\Cross.asv (3718, 2004-02-18)
SGA2.0\Cross.m (3718, 2004-02-18)
SGA2.0\Decode.m (953, 2003-11-06)
SGA2.0\GA.asv (2995, 2004-02-18)
SGA2.0\GA.m (2982, 2004-02-18)
SGA2.0\Mutation.m (2397, 2004-02-18)
SGA2.0\Select.asv (1496, 2004-02-18)
SGA2.0\Select.m (1462, 2003-11-13)
SGA2.0\TestGA.m (350, 2004-04-23)
SGA(Simple Genetic Algorithm)是一种强大的智能多变量优化算法,它模仿种群繁殖规律来进行
优化。
本SGA可以优化变量,求最小值,最大值(当把函数倒数也就求最小值啦)
并且支持浮点编码,grey编码,二进制编码;轮赌法选择,锦标赛选择;单点交叉,均布交叉,浮点交叉;
单点变异,浮点变异;
调用时
SGA很简单不能很好解决问题,如果需要其他版本的可以和我联系。
if you get some problems,you can email to me
and if you want other advanced algorithm,i can contribute them.
everyday i can response to u.
xihuabin@tom.com
shoppingxo@163.net
qq:10901831
Xi Huabin(席华彬)
si vous avons quelquels problèmes,vous pouvez me donner votre Emails;
je peux recevoir Emails tous les jours,
et si vous voulez les nouvelles versions,pas problème!je vous les donne;
环境:MATLAB6.5+ToolBox
使用说明:
1,首先在TestGA.m文件
修改参数
例一
GAPara.MaxGen =100;
% maximum generation
GAPara.SizePop =200;
% size of population
GAPara.StrAimFcn='AimFcn';
% this is function of counting fitness
GAPara.CodeFcn ='float';
% method of coding, you can choose 'float';'grey';'binary'
GAPara.SelectFcn='roulette';
% method of select you can choose 'tournament';'roulette'
GAPara.CrossFcn ='float';
% method of crossover
GAPara.PCross =[0.7];
% probablity of crossover,between 0 and 1
GAPara.MutationFcn='float';
% method of mutation
GAPara.PMutation=[0.01];
% probability of mutation,between 0 and 1
GAPara.LenChrom =[1 1];
% length of bit of every varible
GAPara.Bound =[-10 10;-10 10];
% bounary of every variable
选择了浮点编码,tournament选择,浮点交叉,浮点变异。
注:采用浮点编码时,以后的交叉,变异只能是浮点,且lenchrom向量中都为1,向量长度为待优化变量个数。
bound为各个变量的范围
例二
GAPara.MaxGen =100;
% maximum generation
GAPara.SizePop =200;
% size of population
GAPara.StrAimFcn='AimFcn';
% this is function of counting fitness
GAPara.CodeFcn ='binary';
% method of coding, you can choose 'float';'grey';'binary'
GAPara.SelectFcn='tournament';
% method of select you can choose 'tournament';'roulette'
GAPara.CrossFcn ='uniform';
% method of crossover
GAPara.PCross =[0.7];
% probablity of crossover,between 0 and 1
GAPara.MutationFcn='simple';
% method of mutation
GAPara.PMutation=[0.01];
% probability of mutation,between 0 and 1
GAPara.LenChrom =[10 10];
% length of bit of every varible
GAPara.Bound =[-10 10;-10 10];
% bounary of every variable
选择了二进制编码,tournament选择,均布交叉,单点变异。
注:采用二进制编码和grey编码时,交叉方法只能是simple,uniform,变异方法只能是simple
lenchrom向量中表示变量表示成二进制的位数。
例三
GAPara.MaxGen =100;
% maximum generation
GAPara.SizePop =200;
% size of population
GAPara.StrAimFcn='AimFcn';
% this is function of counting fitness
GAPara.CodeFcn ='grey';
% method of coding, you can choose 'float';'grey';'binary'
GAPara.SelectFcn='roulette';
% method of select you can choose 'tournament';'roulette'
GAPara.CrossFcn ='uniform';
% method of crossover
GAPara.PCross =[0.7];
% probablity of crossover,between 0 and 1
GAPara.MutationFcn='simple';
% method of mutation
GAPara.PMutation=[0.01];
% probability of mutation,between 0 and 1
GAPara.LenChrom =[10 10];
% length of bit of every varible
GAPara.Bound =[-10 10;-10 10];
% bounary of every variable
选择了grey编码,roulette选择,均布交叉,单点变异。
2,然后在AimFcn.m中给出目标函数
目标函数名可以自己定,例如aim(x),参数只能是x,它是向量啦。
象u=x+y+z等函数,就用x(1),x(2),x(3)表示x,y,z 啦。
3,运行TestGA.m文件就可以了。
近期下载者:
相关文件:
收藏者: