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 Center および File ExchangeGenetic Algorithm についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by