Failure in user-supplied fitness function evaluation. GA cannot continue.

11 次查看(过去 30 天)
Hi all,
I was wondering if anyone coud assist me with the following error that I'm receiving in GA, as follows:
clc
clear all
rng default
nvars = 24;
popSize = 48;
lb=ones(1,nvars);
lb(1:24) = 1;
ub = ones(1,nvars);
ub(1:24) = 24;
intCon = 1:24;
options = optimoptions('ga','UseParallel', true, 'UseVectorized', false, 'PopulationSize', popSize,'PlotFcn',@gaplotrange);
[x,fval,exitflag,output,population,score] = ...
ga(@objective,nvars,[],[],[],[],lb,ub,[],intCon, options);
FileName=['_Results_nvars_',num2str(nvars),'_popsize_',num2str(popSize),'_i',num2str(i)];
save(FileName)
[Q_Total_cost,Qsystem_total_heat, Qsystem_total_cool] = building_model(x)
While I'm receiving the follwoing errors:
Caused by:
Failure in user-supplied fitness function evaluation. GA cannot continue.
Failure in initial user-supplied fitness function evaluation. GA cannot continue.
Thank you so much in advance!
  1 个评论
Walter Roberson
Walter Roberson 2020-10-5
The message is saying that objective() applied to the initial population failed.
What does
objective(ones(1,48))
return?
lb=ones(1,nvars);
lb(1:24) = 1;
? The lb is already 1 in those positions ?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surrogate Optimization 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by