1. 程式人生 > >多目標規劃——fgoalattain

多目標規劃——fgoalattain

ali info res 之間 active vector ons 是我 head

多目標規劃

多個目標函數,之間可以用他們的重要程度分析,來一次進行這個序貫算法,當然也可以無限逼近的方案——?

clc,clear;
% 約束
a = [-1 -1 0 0
    0 0 -1 -1
    3 0 2 0
    0 3 0 2];
b = [-30
    -30
    120
    48];
% 求兩次單一目標函數
c1 = [-100 -90 -80 -70];
c2 = [0 3 0 2];
?
% 單一目標值 g1,g2
[x1,g1] = linprog(c1,a,b,[],[],zeros(4,1));
[x2,g2] = linprog(c2,a,b,[],[],zeros(4
,1)); ? % 組合多目標規劃,fgoalattain g3 = [g1 g2]; ? [x,fval] = fgoalattain(Fun,rand(4,1),g3,abs(g3),a,b,[],[],zeros(4,1));

如何設置權重weight呢?

比如:

技術分享圖片

第一個式子的重要程度是20%,第二個式子的重要程度是80%。

哈哈,想到這裏,其實是錯誤的,可以有這種想法,但是我們的多目標規劃問題,就是要無限逼近這兩個目標,不存在說兩個式子哪個重要。哪個重要,還不如用我們的之前的那個序貫算法呢。看看MATLAB官方文檔是如何說的這個參數。

A weighting vector to control the relative underattainment or overattainment of the objectives in fgoalattain
. When the values of goal are all nonzero, to ensure the same percentage of under- or overattainment of the active objectives, set the weighting function to abs(goal). (The active objectives are the set of objectives that are barriers to further improvement of the goals at the solution.)Note Setting a component of the weight
vector to zero will cause the corresponding goal constraint to be treated as a hard constraint rather than as a goal constraint. An alternative method to set a hard constraint is to use the input argument nonlcon.
When the weighting function weight is positive, fgoalattain attempts to make the objectives less than the goal values. To make the objective functions greater than the goal values, set weight to be negative rather than positive. To make an objective function as near as possible to a goal value, use theEqualityGoalCount option and put that objective as the first element of the vector returned by fun (see the preceding description of fun and options).

多目標規劃——fgoalattain