paretoplot
構文
説明
例
問題ベースの解のパレート プロット
最適化変数を使用して多目的最適化問題を作成し、解きます。
x = optimvar("x",LowerBound=-1,UpperBound=2); prob = optimproblem; prob.Objective.obj1 = x^2; prob.Objective.obj2 = (x-1)^2; [sol,fval] = solve(prob,Solver="paretosearch");
Solving problem using paretosearch. Pareto set found that satisfies the constraints. Optimization completed because the relative change in the volume of the Pareto set is less than 'options.ParetoSetChangeTolerance' and constraints are satisfied to within 'options.ConstraintTolerance'.
パレート フロントをプロットします。
paretoplot(sol)
名前付き目的関数のパレート プロット
4 つの名前付き目的関数を含む多目的最適化問題を作成し、解きます。
x = optimvar("x",2,LowerBound=-2,UpperBound=4); prob = optimproblem; prob.Objective.obj1 = norm(x)^2; prob.Objective.obj2 = norm(x - [1;0])^2; prob.Objective.obj3 = norm(x - [0;1])^2; prob.Objective.obj4 = norm(x - [1;1])^2; sol = solve(prob,Solver="paretosearch");
Solving problem using paretosearch. Pareto set found that satisfies the constraints. Optimization completed because the relative change in the distance of the Pareto set is less than 'options.ParetoSetChangeTolerance' and constraints are satisfied to within 'options.ConstraintTolerance'.
最初の 3 つの目的関数のパレート プロットを作成します。
paretoplot(sol)
最後の 3 つの目的関数のパレート プロットを作成します。
paretoplot(sol,["obj2" "obj3" "obj4"])
名前のない多目的関数のパレート プロット (問題ベース)
4 つの目的関数を含む多目的最適化問題を作成し、解きます。目的関数は 4 要素ベクトルを返します。
x = optimvar("x",2,LowerBound=-2,UpperBound=4); prob = optimproblem; obj = [norm(x)^2,norm(x - [1;0])^2,norm(x - [0;1])^2,norm(x - [1;1])^2]; prob.Objective = obj; sol = solve(prob,Solver="paretosearch");
Solving problem using paretosearch. Pareto set found that satisfies the constraints. Optimization completed because the relative change in the distance of the Pareto set is less than 'options.ParetoSetChangeTolerance' and constraints are satisfied to within 'options.ConstraintTolerance'.
最初の 3 つの目的関数のパレート プロットを作成します。
paretoplot(sol)
最後の 3 つの目的関数のパレート プロットを作成します。
paretoplot(sol,[2 3 4])
パレート プロットの編集
最適化変数を使用して多目的最適化問題を作成し、解きます。
x = optimvar("x",LowerBound=-1,UpperBound=2); prob = optimproblem; prob.Objective.obj1 = x^2; prob.Objective.obj2 = (x-1)^2; [sol,fval] = solve(prob,Solver="paretosearch");
Solving problem using paretosearch. Pareto set found that satisfies the constraints. Optimization completed because the relative change in the volume of the Pareto set is less than 'options.ParetoSetChangeTolerance' and constraints are satisfied to within 'options.ConstraintTolerance'.
パレート フロントをプロットします。編集を有効にするには、プロットのハンドルを取得します。
h = paretoplot(sol);
マーカーを青色の 'o'
から赤色の 'x'
に変更します。歪み補正されたビューを表示するには、座標軸の長さが等しくなるように設定します。
h.Marker = "x"; h.MarkerEdgeColor = "r"; axis equal
編集可能なプロパティの完全なリストについては、Scatter のプロパティを参照してください。
入力引数
val
— 最適化値
OptimizationValues
オブジェクト
最適化値。OptimizationValues
オブジェクトとして指定します。通常、vals
は多目的問題の解、solve
の sol
出力です。
paretoplot
は、2 つまたは 3 つの目的関数をプロットできます。3 つを超える目的関数がある場合、paretoplot
は最初の 3 つをプロットします。objlabels
引数または objindex
引数を使用して、プロットする 2 つまたは 3 つの目的関数を指定してください。
例: sol
objlabels
— 目的関数ラベル
string ベクトル
目的関数ラベル。2 つまたは 3 つのエントリの string ベクトルとして指定します。このエントリは、最適化問題の目的関数ラベルです。
例: ["obj1" "obj2"]
データ型: char
| string
objindex
— 目的関数インデックス
正の整数ベクトル
目的関数インデックス。正の整数ベクトルとして指定します。objindex
には、1 ~ 目的関数の数までの範囲で 2 つまたは 3 つのエントリが含まれている必要があります。
例: [4 1 3]
データ型: double
ax
— プロットの座標軸
ハンドル
プロットの座標軸。ハンドルとして指定します。
バージョン履歴
R2022a で導入
参考
paretosearch
(Global Optimization Toolbox) | gamultiobj
(Global Optimization Toolbox) | solve
トピック
- Scatter のプロパティ
- Pareto Front for Multiobjective Optimization, Problem-Based (Global Optimization Toolbox)
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)