Linear constrains meet problem when using parallel GA optimization

I was using following code to do a parallel GA optimization, and it works fine without setting A and b, which is the linear constrains. But when I add A and B, the variable chorm will be 0xn (n is the number of design variables). It's quite wired and I don't know why. Could any one help me with it? Many thanks!
spmd
cd(sprintf('%d', labindex));
end
options = gaoptimset('Generations', control_param.generation_number,... %
'PopulationSize', control_param.population_size,... %
'UseParallel', true,... %
'Vectorized', 'on'); %
[bestchrom,~,~,~,~,~] = ga(@FitnessFcn, nVars, A,b,[],[],Lb,Ub,[],IntCon, options);
function FitVal = FitnessFcn(chrom)
parfor i = 1:size(chrom,1)
FitVal(i,1) = fitness_parallel_f2(chrom(i,:)); %
end
end

3 件のコメント

John D'Errico
John D'Errico 2020 年 6 月 12 日
While we do not have your problem formulation, it is probable that no solution exists that satisfies the constraints.
zexi wang
zexi wang 2020 年 6 月 13 日
Well, the problem now is that the variable 'chrom' is totally empty, but when I do this in a non-parallel version, it's fine. So I think I need to change something when I want to set up this to a parallel version. But I don't know what to do. Maybe I need to change the formulation of A and b.
zexi wang
zexi wang 2020 年 6 月 13 日
It seems the problem caused by using 'Vectorized', 'on' and linear constrains at same time. But I need to do a parallel optimization, without 'Vectorized', 'on' parameter, I don't know how to achieve the parallel computation.

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

回答 (0 件)

カテゴリ

質問済み:

2020 年 6 月 12 日

コメント済み:

2020 年 6 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by