Problems with defining upper and lower bounds

Hi!
I'm trying to run GA with
[x fval] = ga(@objectiveFunction, nvars, [],[],[],[],lower, upper,[], integers, options)
Where:
nvars = 2,
lower = [3 3]
upper = [13 10]
integers = []
Problem is that the parameters sent to the objective function from the GA sometimes are outside the bounds i've specified.
For testing the objective function now only writes it's input to the console and returns a fixed number.
Here's a part of the console output:
param =
0.7289 3.1917
param =
0.9995 7.7736
param =
-1.2105 3.4438
param =
7.9082 6.2424
As you can see several of the values are outside the allowed range. What have i done wrong?
Best regards.
Daniel

 採用された回答

Daniel
Daniel 2012 年 2 月 2 日

0 投票

I solved it by using @mutationadaptfeasible as mutation function!

その他の回答 (1 件)

Sean de Wolski
Sean de Wolski 2012 年 2 月 2 日

0 投票

The final output value is inside the range though, right? I believe ga() is showing every attempt, even if the attempt falls outside of the constraints, but it will converge to something inside the constraints.

3 件のコメント

Daniel
Daniel 2012 年 2 月 2 日
Actually, even the end result is outside the bounds unfortunately.
Sean de Wolski
Sean de Wolski 2012 年 2 月 2 日
What options are you using?
param above, looked like it was working its way in.
Daniel
Daniel 2012 年 2 月 2 日
options = gaoptimset(@ga);
options.Vectorized = 'off';
Basically default options.

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

カテゴリ

質問済み:

2012 年 2 月 2 日

編集済み:

2013 年 9 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by