zhangbingGA
所属分类:人工智能/神经网络/深度学习
开发工具:matlab
文件大小:17KB
下载次数:4
上传日期:2009-03-16 21:33:26
上 传 者:
feiwl
说明: 用简单遗传算法SGA实现的关于控制图的程序,使用实数编码。
(With a simple genetic algorithm SGA about control chart of the implementation procedures, the use of real-coded.)
文件列表:
zhangbingGA\Code.asv (1007, 2009-03-10)
zhangbingGA\Code.m (1088, 2009-03-11)
zhangbingGA\Cross.asv (3772, 2009-03-10)
zhangbingGA\Cross.m (4033, 2009-03-11)
zhangbingGA\Decode.m (953, 2003-07-16)
zhangbingGA\fun.asv (8862, 2009-03-11)
zhangbingGA\fun.m (8864, 2009-03-11)
zhangbingGA\fx.m (48, 2009-03-09)
zhangbingGA\Genetic.asv (4717, 2009-03-11)
zhangbingGA\Genetic.m (4828, 2009-03-11)
zhangbingGA\Mutation.m (2448, 2009-03-11)
zhangbingGA\PHI.asv (95, 2009-03-09)
zhangbingGA\PHI.m (95, 2009-03-09)
zhangbingGA\Select.m (1502, 2003-07-26)
zhangbingGA\shujujiefangcheng.nb (10404, 2009-03-10)
zhangbingGA\test.m (76, 2009-03-11)
zhangbingGA\testAimFunc.m (108, 2009-03-05)
zhangbingGA\tiaojian.asv (909, 2009-03-11)
zhangbingGA\tiaojian.m (921, 2009-03-11)
zhangbingGA\解方程.txt (1988, 2009-03-09)
zhangbingGA (0, 2009-03-11)
SGA(Simple Genetic Algorithm)是一种强大的智能多变量优化算法,它模仿种群繁殖规律来进行
优化。
本SGA可以优化变量,求最小值,最大值(当把函数倒数也就求最小值啦)
并且支持浮点编码,grey编码,二进制编码;轮赌法选择,锦标赛选择;单点交叉,均布交叉,浮点交叉;
单点变异,浮点变异;
调用时
Genetic(目标函数名)
if you get some problems,you can email to me
shoppingxo@hotmail.com
qq:10901831
Xi Huabin(席华彬)
使用环境:MATLAB6.5+ToolBox
使用SGA时,
首先需要一个目标函数(像AimFunc.m),该函数返回适应度
输入变量为待优化变量x
输出为一个适应度。
然后
修改Genetic.m中可以修改的地方
例一
maxgen=200; % maximum generation
sizepop=100; % size of population
AimFunc=StrAimFunc; % this is function of counting fitness
fselect='tournament'; % method of select
% you can choose 'tournament';'roulette'
fcode='float'; % method of coding
% you can choose 'float';'grey';'binary'
pcross=[0.6]; % probablity of crossover,between 0 and 1
fcross='float'; % method of crossover
% you can choose 'float';'simple';'uniform'
pmutation=[0.2]; % probability of mutation,between 0 and 1
fmutation='float'; % method of mutation
% you can choose 'float';'simple';
lenchrom=[1 1 1 1 1]; % length of bit of every varible
bound=[0 1;...
0 1;...
0 1;...
0 1;...
0 1];
选择了浮点编码,tournament选择,浮点交叉,浮点变异。
注:采用浮点编码时,以后的交叉,变异只能是浮点,且lenchrom向量中都为1,向量长度为待优化变量个数。
bound为各个变量的范围
例二
maxgen=200; % maximum generation
sizepop=100; % size of population
AimFunc=StrAimFunc; % this is function of counting fitness
fselect='tournament'; % method of select
% you can choose 'tournament';'roulette'
fcode='binary'; % method of coding
% you can choose 'float';'grey';'binary'
pcross=[0.6]; % probablity of crossover,between 0 and 1
fcross='uniform'; % method of crossover
% you can choose 'float';'simple';'uniform'
pmutation=[0.2]; % probability of mutation,between 0 and 1
fmutation='simple'; % method of mutation
% you can choose 'float';'simple';
lenchrom=[10 10 10 10 10]; % length of bit of every varible
bound=[0 1;...
0 1;...
0 1;...
0 1;...
0 1];
选择了二进制编码,tournament选择,均布交叉,单点变异。
注:采用二进制编码和grey编码时,交叉方法只能是simple,uniform,变异方法只能是simple
lenchrom向量中表示变量表示成二进制的位数。
例三
maxgen=200; % maximum generation
sizepop=100; % size of population
AimFunc=StrAimFunc; % this is function of counting fitness
fselect='roulette'; % method of select
% you can choose 'tournament';'roulette'
fcode='grey'; % method of coding
% you can choose 'float';'grey';'binary'
pcross=[0.6]; % probablity of crossover,between 0 and 1
fcross='uniform'; % method of crossover
% you can choose 'float';'simple';'uniform'
pmutation=[0.2]; % probability of mutation,between 0 and 1
fmutation='simple'; % method of mutation
% you can choose 'float';'simple';
lenchrom=[10 10 10 10 10]; % length of bit of every varible
bound=[0 1;...
0 1;...
0 1;...
0 1;...
0 1];
选择了grey编码,roulette选择,均布交叉,单点变异。
近期下载者:
相关文件:
收藏者: