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

20 views (last 30 days)
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 Comment
Walter Roberson
Walter Roberson on 5 Oct 2020
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 ?

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!