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

조회 수: 5 (최근 30일)
Mohammad Dabbagh
Mohammad Dabbagh 2020년 10월 4일
댓글: Walter Roberson 2020년 10월 5일
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