Effect of GA population size and Number of generation with many variables

12 ビュー (過去 30 日間)
Rawit Janrat
Rawit Janrat 2022 年 2 月 27 日
回答済み: Ayush Aniket 2024 年 12 月 20 日
first of all i'm not good at computer programming and i'm not a native English speaker if moderator or others find this frustating,I'm apologising for my mistake
my objective function has 240 variables with the given options
options = optimoptions('ga','Generations',1000,'PopulationSize',500,'MaxStallGenerations',1000,...
'MutationFcn',{@mutationadaptfeasible},'CrossoverFraction',0.9,...
'CrossoverFcn',{@crossoverintermediate},'FunctionTolerance',0.01,...
'SelectionFcn',{@selectionroulette},'Display','iter',...
'EliteCount',48,'PlotFcn',{@gaplotbestf,@gaplotdistance});
from my objective function when having a smaller population size it doesn't give an optimal result also doesn't satisfy the constraints.
with given population size (500) it takes too long to run but sometimes the result satisfy constraints and sometimes don't.
which mean i have to increase population size? but how much without guessing and spent a whole lot of time testing
e.g I create my own constraints using if else and lagrange multiplier formula which cost the objective function m file has between 7000 lines
e.g 2 -> have to use GA.I got assigned to do GA with the problem.
Thank you in advance for any suggestive answer

回答 (1 件)

Ayush Aniket
Ayush Aniket 2024 年 12 月 20 日
Increasing the population size or number of generations leads to increase in execution time as well. Taking the population size as 500 is also not suggested.
To tune the Genetic Algorithm operations in order to improve your solution, the closest workaround will be to change the "crossover" function and check which one is working the best. Refer to the following MATLAB answer: https://www.mathworks.com/matlabcentral/answers/1732700-how-does-crossover-occur-in-a-genetic-learning-algorithm-do-genes-ever-mix-change-locations#answer_1304186?s_tid=prof_contriblnk
You may need to implement Genetic Algorithm from scratch to twist things according to you.

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by