using genetic algorithm optimizer to figure out points that satisfy the imposed constraints
2 ビュー (過去 30 日間)
古いコメントを表示
I want to find points that satisfy a set of constraints only using GA. It is not necessary to be optimal points. Some of the constraints depend on simulation evaluations. I did it by providing a constant fitness function(e.g., f(x) = 1), but it gave me the following error: Failure in user-supplied fitness function evaluation. Cannot continue. Failure in initial user-supplied fitness function evaluation. GA cannot continue. any idea?
0 件のコメント
回答 (2 件)
Renee Coetsee
2017 年 4 月 14 日
There are couple reasons that you could be getting this error.
- This error occurs when the objective function produces a NaN output. To fix this, edit the function so that it does not produces NaN values, or set constraints on the function's inputs to prevent the objective function from producing NaN outputs.
- If you have nonlinear constraints, make sure that you are following this note in the documentation page for "ga":
"Note: Passing Extra Parameters (Optimization Toolbox) explains how to pass extra parameters to the objective function and nonlinear constraint functions, if necessary."
Alan Weiss
2017 年 4 月 19 日
You did not show us how you defined your objective function. Here is one that will work:
fun = @(x)1;
Alan Weiss
MATLAB mathematical toolbox documentation
参考
カテゴリ
Help Center および File Exchange で Genetic Algorithm についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!