필터 지우기
필터 지우기

Problem with Genetic Algorithm using the global optimization toolbox

조회 수: 4 (최근 30일)
vinay
vinay 2013년 8월 22일
Hi,
I am implementing an optimization problem using GA in Matlab. I use the Matlab Global optimization toolkit. It gives fine results when I use it without non linear constraints.
However when I add even a trivial nonlinear constraint (such as c = -1, in the i.e. in reality this constraint is always satisfied.), the GA does not proceed over 1 generation.
Below is an example of output from the Solver, which I manually terminated:
1 504 -64.5333 0 0
As you see, the solver has computed the fitness function 504 times and is still stuck in the 1 st generation.
My nonlinear function is as follows:
***************************************
function [c, ceq] = nonlcon(ae)
c = -1; ceq = [];
end
***************************************
As you can see, the nonlinear constraint is always satisfied. I must emphasis that the solver gives the expected result when I run without using the nonlinear constraint function option.
Vinay
Why is this so? I
  댓글 수: 1
vinay
vinay 2013년 8월 22일
Update: The solver did proceed to the second generation, but after 40,000 calls to the fitness function! The constraint is very trivial. I do not understand why it evaluated the fitness so many times.

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

답변 (2개)

Geert
Geert 2013년 8월 22일
Can you give some more details about your genetic algorithm? How many variables, crossover/mutation operator, ... Maybe a code snippet or something?
Since your nonlinear contraint is of the form
function [c, ceq] = nonlcon(ae)
c = -1; ceq = [];
end
I assume that you optimize over a singly variable (i.e. length(ae) = 1)?
Please provide us with more details, if you want us to solve your problem...
  댓글 수: 1
vinay
vinay 2013년 8월 23일
편집: vinay 2013년 8월 23일
No of Variables : 3
Pop Size: 8
Crossover: CrossoverIntermediate
Mutation: MutationUniform
Fitness Function: I calculate the Peak Gain of Antenna Array Distribution.
No Linear constraints.
The solver works well when I do not include the nonlinear constraint.

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


Alan Weiss
Alan Weiss 2013년 8월 22일
The inclusion of a nonlinear constraint function causes ga to perform a very different algorithm. See Nonlinear Constraint Solver Algorithm.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
vinay
vinay 2013년 8월 23일
Dear Alan,
I also tried Pattern Search. I face the same problem. Without including the non linear constraints solver I get expected answer. However on including the constraints the PS solver doesnt proceed over 1 poll. I does 2-3 Iterations. (Number of Variables in Problem is N = 3, and I use GPS2N solver)
I read that both GA and Pattern Search use the same Nonlinear Constraints Solver Algorithm.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by