GA is not satisfying nonlinear constraints

1 回表示 (過去 30 日間)
구구
구구 2022 年 1 月 6 日
コメント済み: 구구 2022 年 1 月 10 日
I'm using GA to optimize geometry for maximum safety ratio.
Input parameter contain length, width, and etc, and the nonlinear constraints, for example, sum of length and width is less than that of inital geometry.
UseParallel option is set for true.
When I run the code, because of geometry error, the code stops so I added a code to check if input parameters are satisfying the nonlinear constraints.
How to make each generation and each population always satisfy nonlinear constraints?

採用された回答

Alan Weiss
Alan Weiss 2022 年 1 月 7 日
The answer is that you cannot ensure that nonlinear constraints are satisfied at every step. Instead, your code must accept points that are infeasible and handle them appropriately. You can put try-catch statements in your code to handle errors that result from infeasible points, or do something else. Your code usually should return NaN for infeasible points. Or it can return an arbitrary large value, such as 1e6, which presumably is too large to be a minimum.
Alan Weiss
MATLAB mathematical toolbox documentation
  1 件のコメント
구구
구구 2022 年 1 月 10 日
Thank you for your answer. Problem fixed!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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