/Genetic-Algorithm

Contains a wide variety of genetic algorithm variants

Primary LanguageMATLAB

Genetic-Algorithm

Contains a wide variety of genetic algorithm variants 说明: fitness1和fitness2为两个定义的函数,即遗传算法中的自适应函数 myGA:最为基本的遗传算法函数
实例:[xv,fv]=myGA(@fitness1,0,30,50,100,0.9,0.04,0.01) SBOGA:顺序选择遗传算法 优点:从顺序选择的选择概率计算公式可以看出,每个个体都有可能被选中从而产生后代 实例:[xv,fv]=BOGA(@fitness1,0,30,50,100,0.9,0.04,0.01) NormFitGA:动态线性标定适应值的遗传算法 优点:有时由于目标函数之间的相对差别很小,从而各个个体的选择概率差别很小, 此时各个个体被选择的几率几乎一样,这将导致遗传算法的选择功能被弱化, 此时需要对目标函数进行标定(也就是进行变换) [xv,fv]=NormFitGA(@fitness3,0,4,50,500,2,0.9,0.9,0.04,0.01) GMGA:大变异遗传算法 优点:大变异操作可以使算法避免“早熟”。单靠传统的变异操作需要很多代才能变异出一个不同于其他个体的新个体。 实例:[xv,fv]=GMGA(@fitness4,0,4,50,500,0.9,0.03,0.6,0.2,0.01) AdapGA:自适应遗传算法 优点:交叉概率和变异概率能够随适应度自动改变。 实例:[xv,fv]=AdapGA(@fitness5,0,4,50,500,0.5,0.9,0.02,0.05,0.01) DblGEGA:双切点交叉遗传算法 优点:单点交叉遗传使得父代双方交换基因量较大,有时候很容易破坏优秀个体 实例:[xv,fv]=Db1GEGA(@fitness6,0,1,50,500,0.9,0.05,0.01) MMAdapGA:多变异遗传算法 优点:引入多位变异,以增加种群的多样性 实例:[xv,fv]=MMAdapGA(@fitness7,0,1,80,500,0.6,0.9,0.02,0.05,0.01)