How ca I calculate the dominance between two popultion?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello every one ,
I have a problem and I want to solve it, so
I have two population pop and Pool type struct
pop: Position []
Cost []
Pool:
pop has value in both field
example
pop(1): [123, 0 , 1000, 52, 54, 200]
[0 4 0 210]
note Cost has always 4 values
and the size of Position is fixed (100)
I want to compare each line from pop with Pool by using Dominance concept
at the first time Pool is empty
for s=1:N
if ~isempty(Pool)
for c=1:numel(Pool)
if ~Dominates(pop(s),Pool(c))
pop(s).IsDominated=true;
Pool(c)=[];
Pool=[Pool pop(s)];
end
end
else
Pool=[Pool pop(s)];
end
end
I try this code but ir doesn't work, an arror appear
Error using <=
Matrix dimensions must agree.
Error in Dominates (line 24)
b=all(x<=y) && any(x<y);
The dominates function is as follow:
function b=Dominates(x,y)
if isstruct(x)
x=x.Cost;
end
if isstruct(y)
y=y.Cost;
end
b=all(x<=y) && any(x<y);
end
Please help me
THank you.
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!