How to ask Matlab ga to continously regenerate individuals until they all satisfy user defined constraints prior to fitness evaluation

조회 수: 1 (최근 30일)
Dear all,
I am currently using matlab ga to set up an optimisation process, with a FE solver used for fitness value calculation. In my model, the design variables of each individual must satisfy a nonlinear constraint to ensure the FE model being successfully built and running okay in the evaluation phase for all generations.
I then wrote an nonlinear constraint function to do this but I found that not all individuals satisfy the constraint I've defined. For intances, if the population size is 100, there might be only 20 individuals that satisfy the constarint. I therefore wonder if there would be a way to ask matlab ga to continously generate individual until all individuals in the population satisfy the user defined constraints or pre-checking functions?
Any help is appreciated.

채택된 답변

Matt J
Matt J 2024년 3월 7일
편집: Matt J 2024년 3월 7일
The way to handle that is to have the fitness function skip the FE modeling and return Inf (or some large penalizing value) if the constraints are not satisfied.
  댓글 수: 1
fei yu
fei yu 2024년 3월 8일
Thanks for your advice, Matt. It works alright for now.
It seems that matlab ga can somehow adjust the value of design variables to enable more more individuals in the subsequent generations to meet the constraint I defined. Besides, this also leads to an increase in the total runtime for the following generations as the optimisation proceeds, due to the growing number of "good" individuals.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by