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

5 vues (au cours des 30 derniers jours)
Mohammad Dabbagh
Mohammad Dabbagh le 4 Oct 2020
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 commentaire
Walter Roberson
Walter Roberson le 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 ?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Surrogate Optimization dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by