-
大小: 11KB文件類型: .zip金幣: 2下載: 0 次發布日期: 2021-05-28
- 語言: Matlab
- 標簽: matlab??NSGA-II??constraints??
資源簡介
帶有約束條件的NSGA-2算法及過程解釋。
可以參考我之前寫的代碼解釋。
直接放到matlab中運行主函數,輸入測試函數序號,就可以運行。

代碼片段和文件信息
function?child_offspring??=?genetic_operator(parent_selected)
global?V?xl?xu?etac?
%?1.?交叉&變異
%?2.?選擇錦標賽完成后的個體進行交叉變異;
%?3.?輸出?‘child_offspring‘.?
%%?Reference?
%?Deb?&?samir?agrawal“A?Niched-Penalty?Approach?for?Constraint?Handling?in?Genetic?Algorithms“.?
%%?SBX?cross?over?operation?incorporating?boundary?constraint
[N]?=?size(parent_selected1);
xl1=xl‘;
xu1=xu‘;
rc=randperm(N);
for?i=1:(N/2)
????parent1=parent_selected((rc(2*i-1)):);
????parent2=parent_selected((rc(2*i)):);
????if?(isequal(parent1parent2))==1?&?rand(1)>0.5
????????child1=parent1;
????????child2=parent2;
????else?
????????for?j?=?1:?V??
????????????if?parent1(j) ???????????????beta(j)=?1?+?(2/(parent2(j)-parent1(j)))*(min((parent1(j)-xl1(j))(xu1(j)-parent2(j))));
????????????else
???????????????beta(j)=?1?+?(2/(parent1(j)-parent2(j)))*(min((parent2(j)-xl1(j))(xu1(j)-parent1(j))));
????????????end???
????????end
?????????u=rand(1V);
?????????alpha=2-beta.^-(etac+1);
?????????betaq=(u<=(1./alpha)).*(u.*alpha).^(1/(etac+1))+(u>(1./alpha)).*(1./(2?-?u.*alpha)).^(1/(etac+1));
????????child1=0.5*(((1?+?betaq).*parent1)?+?(1?-?betaq).*parent2);
????????child2=0.5*(((1?-?betaq).*parent1)?+?(1?+?betaq).*parent2);
????end
????child_offspring((rc(2*i-1)):)=poly_mutation(child1);???????????%?polynomial?mutation
????child_offspring((rc(2*i)):)=poly_mutation(child2);?????????????%?polynomial?mutation
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-10-26?00:21??Constrained?NSGA2\
?????文件????????4682??2019-10-25?23:42??Constrained?NSGA2\Main_NSGA2.m
?????文件????????5637??2019-10-25?22:25??Constrained?NSGA2\NDS_CD_cons.m
?????文件????????2063??2015-02-24?10:48??Constrained?NSGA2\Readme.m
?????文件????????1465??2019-10-25?23:14??Constrained?NSGA2\genetic_operator.m
?????文件????????1319??2015-02-24?10:48??Constrained?NSGA2\license.txt
?????文件?????????686??2019-10-25?18:27??Constrained?NSGA2\normalisation.m
?????文件?????????582??2015-02-24?10:48??Constrained?NSGA2\poly_mutation.m
?????文件?????????611??2019-10-25?23:24??Constrained?NSGA2\replacement.m
?????文件????????3458??2019-10-25?05:54??Constrained?NSGA2\test_case.m
?????文件????????1575??2019-10-25?23:12??Constrained?NSGA2\tour_selection.m
- 上一篇:深度置信網絡時間序列預測.zip
- 下一篇:matlab fsk
評論
共有 條評論