genetic algorithm simple problem
1 回表示 (過去 30 日間)
古いコメントを表示
Hello ,
I have a simple problem to solve with the genetic algorithm in matlab
The fitness function is
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/198740/image.png)
that subject to
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/198741/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/198742/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/198743/image.png)
My question is how to apply these in matlab ga function?
2 件のコメント
回答 (1 件)
Walter Roberson
2018 年 12 月 10 日
The item says 0 <= xi, i = 1, 2, 3. Therefore the entries are nonnegative. lb would be [0 0 0]. ub can be left empty or can be set to [inf inf inf]
2 件のコメント
Walter Roberson
2018 年 12 月 10 日
So? You are using ga and ga only tries to find a global minima.
Besides, you are not implementing the formula you were given. In MATLAB,
(3*x(1) + x(2) - 2*x(3)+0.8 \ 2*x(1)-x(2)+x(3))
is the same as
((3*x(1)) + x(2) - (2*x(3)) + ((0.8 \ 2) * x(1)) - x(2) + x(3))
which is the same as
((3*x(1)) + x(2) - (2*x(3)) + ((0.8 / 2) * x(1)) - x(2) + x(3))
The form
first sequence \ second sequence
is not the same as
(first sequence) / (second sequence)
参考
カテゴリ
Help Center および File Exchange で Genetic Algorithm についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!