MATLAB Answers

using genetic algorithm optimizer to figure out points that satisfy the imposed constraints

3 views (last 30 days)
Mustafa Al-tekreeti
Mustafa Al-tekreeti on 11 Apr 2017
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?


Sign in to comment.

Answers (2)

Renee Bach
Renee Bach on 14 Apr 2017
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."

Community Treasure Hunt

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

Start Hunting!

Translated by