필터 지우기
필터 지우기

How can I set bounds for ga that change with the values of the optimization variables?

조회 수: 4 (최근 30일)
Hi. I have lower and upper bounds for my ga optimization variables that depend on those variables' values. Is there a way to input the values of the variables in each iteration of the ga into functions that compute the lower and upper bounds vectors and input those lb and ub back into the ga?

채택된 답변

John D'Errico
John D'Errico 2022년 3월 13일
You cannot. Bounds are FIXED constants. They do not vary at all, and the optimizer assumes that as fact.
If you have a constraint that is a function of the parameters, then that is a nonlinear constraint. Or a linear one, if it can be writtten as a linear combination of the parameters.
  댓글 수: 1
Radu Andrei Matei
Radu Andrei Matei 2022년 3월 14일
Thanks. I've tried to apply this and of course, a cascade of other problems appeared. I've posted another question relating this one, I'd greatly appreciate it if you could check that one out aswell. But in any case, thanks for your quick and useful answer :)

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

추가 답변 (1개)

Torsten
Torsten 2022년 3월 13일
Instead of using the array lb and ub, you will have to prescribe such bounds that depend on the solution variables in the Constraint Function, usually called "nonlcon" in the documentation.
  댓글 수: 2
Walter Roberson
Walter Roberson 2022년 3월 13일
However, it is common to use lb ub and linear or nonlinear constraints. lb and ub are the fastest kind of constraints; linear constraints are a little slower (they require multiplications), and nonlinear constraints are slowest.
Radu Andrei Matei
Radu Andrei Matei 2022년 3월 14일
Hi, thank you for your answer. I've accepted the other one as it was similarly helpful but responded before.

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

카테고리

Help CenterFile Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by