在 MATLAB 的全局优化工具箱中使用该函数时,我遇到了一个令人费解的错误ga
,错误消息粘贴在下面,看看是否有人能破译这意味着什么。
我正在尝试ga
使用初始种群(pop-by-nvar)来播种。但是,这会产生以下错误。ga
如果我传入 (pop-1)-by-nvar 的初始种群向量,我只能运行。这有点不方便,因为我想指定整个人口。希望熟悉全局优化工具箱和ga
功能的朋友在这里指点一下!
??? Index exceeds matrix dimensions.
Error in ==> gacreationlinearfeasible>lhsLambda at 213
[lambda(i,:),f,e] = fmincon(fun,lambda(i,:),[],[],Aeq,beq,lb,ub,[],opts);
Error in ==> gacreationlinearfeasible>feasibleLHS at 180
initialPopulation(boundary_points+1:interior_points+boundary_points,:) = ...
Error in ==> gacreationlinearfeasible at 42
feasiblePop = feasibleLHS(individualsToCreate,GenomeLength,options);
Error in ==> makeState at 30
state.Population = feval(options.CreationFcn,GenomeLength,FitnessFcn,options,options.CreationFcnArgs{:});
Error in ==> galincon at 18
state = makeState(GenomeLength,FitnessFcn,Iterate,output.problemtype,options);
Error in ==> ga at 282
[x,fval,exitFlag,output,population,scores] = galincon(FitnessFcn,nvars, ...