How to use Genetic Algorithm (GA) for multi-objective function (Dynamic Optimization)?
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
I need to optimize this multiobjective function using GA:
Z=min(2X+Y);
X= sum (a1+b1+c1-d1+(N1/S))
Y= sum (a2+b2+c2-d2+(N2/S))
All other variables are known (however, dynamically changed), excepted (b1,b2) which needed to optimized to get the optimal value of (Z)
1 件のコメント
採用された回答
This does not look like a multiobjective problem to me. You have a single scalar objective Z. Furthermore, it seems to be an unbounded problem, with no finite minimum (I mean it seems that b1 and b2 could take the values -Inf, and then Z would also have the value -Inf, which is the minimum).
If I misunderstand, feel free to clarify.
Alan Weiss
MATLAB mathematical toolbox documentation
11 件のコメント
I am afraid that I find your comments unintelligible. Do you have just one objective, Z? If so, why do you want to maximize b1 and b2? How do X and Y depend on b1 and b2 other than through the linear expressions you already gave? And why does it matter, if all you ultimately want to do is minimize Z?
In order to make your problem clear, please give a concise statement of the objective or objectives (if different from what you already gave) and of any constraints that might exist.
Alan Weiss
MATLAB mathematical toolbox documentation
Sherif Shokry
2018 年 1 月 15 日
編集済み: Walter Roberson
2018 年 1 月 15 日
Mr.Alan Weiss, Regarding your 1st comment the objective function
Z=min(2X+Y);
X= sum (a1+b1+c1-d1+(N1/S)) b1 subject to (0,upper limit)
Y= sum (a2+b2+c2-d2+(N2/S)) b2 subject to (0,upper limit)
to ensure that b1 and b2 would not take the values -Inf,
That is not multi-objective. This is minimization of
2 * sum (a1+b1+c1-d1+(N1/S)) + sum (a2+b2+c2-d2+(N2/S))
with lower bound [0, 0] and upper bound whatever limits are appropriate.
Thank you for your quick response. If it's not a muti-objective function, could you please recommend me the best way to solve this fitness function. Note: this fitness function for dynamic iteration
function y = fitness(b, a, c, d, N, S)
a1 = a(1); a2 = a(2);
b1 = b(1); b2 = b(2);
c1 = c(1); c2 = c(2);
d1 = d(1); d2 = d(2);
y = 2 * sum(a1+b1+c1-d1+(N1./S)) + sum(a2+b2+c2-d2+(N2./S));
together with calling your favorite minimizer with
... define a1, a2, c1, c2, d1, d2, N, S. Then
fun = @(b) fitness(b, [a1,a2], [c1,c2], [d1,d2], N, S);
A = []; b = [];
Aeq = []; beq = [];
lb = [0 0]; ub = [appropriate upper bounds];
For example,
b0 = rand(1,2);
b = fmincon(fun, b0, A, b, Aeq, beq, lb, ub);
This assumes that a1, a2, c1, c2, d1, d2 are all scalars and that the vector is either N or S.
Thank you Mr.Roberson, I got this error when I tried to recall the dynamic variables for the fitness function from the main.m file. Please kindly find my fitness.m file
Please attach all of your code as individual files (posted the way you have, I cannot tell where the files begin and end.)
I do not understand what you mean by saying that you are trying to recall the dynamic variables for the fitness function from the main.m file? Variables you calculate in the fitness function are in the workspace of the fitness function and are not available to the main function.
Perhaps you should consider an arrangement such as:
function y = fitness(b, a, c, d, N, S)
[variable1, variable2, variable3...] = calculate_intermediate_variables(b, a, c, d, N, S);
y = some_function(variable1, variable2, variable3);
And then when you have found the best fit and need the temporary variables that would be calculated for it, call
[variable1, variable2, variable3...] = calculate_intermediate_variables(best_b, a, c, d, N, S);
This arrangement is a lot easier than arranging to have fitness store the variables where your main routine can find them.
Thank you for your kind response. I would like to attach here the main.m file named (VISSIM.COM1) and the fitness.m file named (extension). However, let me draw your attention it may not be working since this code is manipulating a simulation software via COM interface. Also, let me clarify the meaning of (recall the variables values), this process aims to input the variable values into the fitness function since this variables is in a dynamic iteration and the fitness function is done iteratively
I think the function (fmincon) is not appropriate to my case. In my case I'm seeking (b) variables which achieve the optimal (y). However, if I understood correctly (fmincon) finds (y) variables that achieve optimal (b).
"However, if I understood correctly (fmincon) finds (y) variables that achieve optimal (b)."
No, fmincon seeks the inputs that give the lowest outputs.
However, fmincon is a local minimizer -- it gets stuck in local minima.
"this process aims to input the variable values into the fitness function since this variables is in a dynamic iteration and the fitness function is done iteratively"
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Solver Outputs and Iterative Display についてさらに検索
タグ
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
