Question regarding Genetic Algorithm
古いコメントを表示
Hi,
I would like to maximize a function with a constraint using the genetic algorithm. The problem is that for the 'x' vector I would like only values like those 0,[min,max]. So I can't use the boundary condition because it will exclude zero.
Thank you for your ideas.
regards.
回答 (1 件)
Alan Weiss
2013 年 12 月 2 日
0 投票
Perhaps you can encode your problem as integer. Set lb = zeros(1,N), ub = 2+lb. When x = 0, you are set. When x = 1, map it to [min]. When x = 2, map it to [max].
But perhaps what you mean is your x variables are either 0 or are continuous between min and max. In that case, I suggest you make two variables for each component, one binary (I mean 0 or 1). The other should be continuous between min and max. Set the final variable to be binary*continuous.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
2 件のコメント
Guillaume
2013 年 12 月 3 日
Alan Weiss
2013 年 12 月 3 日
Suppose your x is two-dimensional, x(1) and x(2). Create x(3) and x(4) as binary variables, and let x(1) and x(2) vary between min and max. Set z(1) = x(1)*x(3) and z(2) = x(2)*x(4). Then the variable z has the properties you want. Do all your calculations with input variables x(1)...x(4) and output variables z.
Alan Weiss
MATLAB mathematical toolbox documentation
カテゴリ
ヘルプ センター および File Exchange で Genetic Algorithm についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!