www.gusucode.com > matlab编程求解机器人的正逆解 采用遗传算法对机器人进行路径规划源码程序 > code/遗传算法/Genetic_init.m
%此为遗传算法的参数初始化函数 %种群数量 popSize = 50; %种群个体 vecPop = cell(1,popSize); P_k = 1; %适应度 totalFitness = 0; %总适应度 averageFitness = 0; %适应度平均值 bestFitness = 0; %最适应个体适应度 worstFitness = 0; %最不适应个体适应度 fitbestGenome = zeros(1,14); %最适应个体 %基因突变的概率 matationRate = 0.005; %交叉概率 crossoverRate = 0.93; %代数计数器 generation = 1; bestGeneration = zeros(1,14); totalGeneration = 1000;