% 遍歷所有m個目標值
for obj_index=1:global.m
if newpop.obj(obj_index)<=population(i).obj(obj_index)
% 如果目標值小於等於則計數值加1
offspringless_or_equal= offspringless_or_equal+1;
if newpop.obj(obj_index)0))
population(i)=newpop;
%如果兩者非支配
elseif((offspringless>0)&&(parentless>0))
/**
.* compares two solutions.
* * @param object1
* object representing the firstsolution
* @param object2
* object representing the second
solution
.* @return -1, or 0, or 1 if solution1 dominates solution2, both are
* non-dominated, or solution1 is dominated by solution22,
* respectively.
*/public int compare(object object1, object object2)
*/double value1, value2;
for (int i = 0; i < solution1.getnumberofobjectives(); i++) else if (value1 > value2) else
if (flag == -1)
if (flag == 1)
}if (dominate1 == dominate2)
if (dominate1 == 1)
return 1; // solution2 dominate
} // compare
} // dominancecomparator
count=0;
frontnumbers=;
for i=1:pop
for j=i:pop
if i==j
continue;
endbetter=0;
worse=0;
if population(i).convio < population(j).convio
% convio是zdt4-rc才會使用的屬性
population(i).dominatedset=[population(i).dominatedset j];% 但是j是索引,不是個體還是需要注意!
population(i).dominatedsetlength=population(i).dominatedsetlength+1;% 支配解的數量
population(j).dominationcount=population(j).dominationcount+1;% 被支配解的數量
% 相對而言,如果j支配了i的話
elseif population(i).convio > population(j).convio
population(j).dominatedset=[population(j).dominatedset i];
population(j).dominatedsetlength=population(j).dominatedsetlength+1;
population(i).dominationcount=population(i).dominationcount+1;
else
% 最後是為非zdt-rc問題設計的,因為非zdt4-rc中沒有convio引數
for k = 1:no_of_objs
if population(1).skill_factor == 1
if population(i).objs_t1(k) < population(j).objs_t1(k)
better=1;
elseif population(i).objs_t1(k) > population(j).objs_t1(k)
worse=1;
endelse
if population(i).objs_t2(k) < population(j).objs_t2(k)
better=1;
elseif population(i).objs_t2(k) > population(j).objs_t2(k)
worse=1;
endend
endif worse==0 && better>0 %如果j在任何乙個目標上都不比i好,並且i在乙個目標上比j好
population(i).dominatedset=[population(i).dominatedset j];
population(i).dominatedsetlength=population(i).dominatedsetlength+1;
population(j).dominationcount=population(j).dominationcount+1;
elseif better==0 && worse>0%如果i在任何乙個目標上都不比i好,並且j在乙個目標上比j好
population(i).dominationcount=population(i).dominationcount+1;
population(j).dominatedset=[population(j).dominatedset i];
population(j).dominatedsetlength=population(j).dominatedsetlength+1;
endend
end% 如果沒有解可以支配當前解,則被認為是非支配前沿
if population(i).dominationcount==0
population(i).front=1;
count=count+1;
end
end
多目標優化按支配關係分層實現
count剛開始儲存的是front0中解的個數 while count 0 count 0 front front 1 此時front從1開始計數 for i 1 pop if population i front front 篩選當前front元素 對於pop i 支配的每個個體 for j 1 ...
多目標優化問題 投資組合的多目標優化
一 多目標問題 二 多目標規劃有效解 1 有效點 參考定理 2 凸多目標規劃 詳細見參考文獻1 3 絕對最優解 有效解 弱有效解 絕對最優解 有效解與弱有效解 4 真有效解 由於有效解的範圍過大,有時候要在要在有效解的範圍內加以限制定義了真有解。根據不同的限制定義了許多不同的真有效解。5 極錐解與非...
多目標優化 1 多目標優化的相關基本概念
在學習多目標優化的過程中,尤其涉及pareto相關知識的一些概念的時候,公式與嚴謹邏輯的定義,在初學狀態下,很難準確的認識並理解這些概念,本文重點就是將學習的過程中,對這些概念的自己理解,用較通俗的語言整理出來。1 支配 對於多個目標值,隨機自變數。3 互不支配 對於多個目標值,隨機自變數,使互不支...