How to set a suitable range for variables in Genetic Algorithm Optimization

조회 수: 6 (최근 30일)
Qigang Wu
Qigang Wu 2020년 11월 10일
편집: Qigang Wu 2020년 11월 10일
Hi, I have a optimization problem and its variable x has some limitations as belows:
and for each variables, ,all x(i) is integer.
For my understanding, the ga function will generate 300 random values within the range of x(i) and calculate the fitness fcn. if all constraints are met.
Such as:
rng(0,'twister');
variable_num=300;
LB=zeros(1,variable_num);
UB=100*ones(1,variable_num);
A=ones(1,variable_num);
b=1000;
GASetting = optimoptions(@ga,'PopulationSize',10000,'MaxGenerations',1000);
[x,fval,exitflag,output,population,scores] = ga(@test,variable_num,A,b,[],[],LB,UB,[],1:variable_num,GASetting);
Is there any functions or settings for forcing the software to generate a total number where less than 1000 and distributed to each variables randomly? Because in the code displayed before, GA cannot find a feasible points for calculating the user-defined function.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by