Stop mutation in GAMULTIOBj

2 ビュー (過去 30 日間)
Dilini
Dilini 2014 年 12 月 21 日
回答済み: Zhangxi Feng 2018 年 6 月 19 日
Hi, I tried this simple problem with an initial population. I want to find the best set of combinations of these variables without altering their values. This I'm trying to get by having only crossover children. As I understand from the documentation this can be done by setting crossoverfraction to 1. But I don't get the expected result.
e.g.
P_s=randi(20,3,9);
numberOfVariables=9;
FitFunc = @multiobjectiveFit;
options = gaoptimset('CrossoverFraction',1,'InitialPopulation',P_s,'CrossoverFcn',@crossovertwopoint)
[x,fval,exitflag]=gamultiobj(FitFunc,numberOfVariables,[],[],[],[],[],[],options);
function y=multiobjectiveFit(x)
y = zeros(2,1);
y(1) =-sum(x);
y(2) =var(x);
gives me a new set of populations x with non-integer values whereas I started with integer values. Please help me. (FYI: My original problem has a very large initial population with non-integer values)
  1 件のコメント
Dilini
Dilini 2014 年 12 月 21 日
May be I mis-interpreted the document. In crossover it doesn't simply swap the elements it combines them whereas in mutation it alters the value, isn't it? May be I should write my own crossover function?

サインインしてコメントする。

回答 (1 件)

Zhangxi Feng
Zhangxi Feng 2018 年 6 月 19 日
Sad no one answers this question. I am trying to understand the whole process more also. I believe making your own creation, selection, crossover, and mutation functions are definitely the way to go if you have a specific need.

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by