-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnon_domination.m
36 lines (32 loc) · 997 Bytes
/
non_domination.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function f = non_domination(x, M, V)
[N, m] = size(x);
% Number of individuals that dominate this individual
individual = zeros(N,1);
tic
for i = 1 : N
i
for j = 1 : N
dom_less = 0;
dom_equal = 0;
dom_more = 0;
for k = 1 : M %loops over the M objecties
if x(i,V + k) < x(j,V + k)
dom_less = dom_less + 1;
elseif (x(i,V + k) == x(j,V + k))
dom_equal = dom_equal + 1;
else
dom_more = dom_more + 1;
end
end
if dom_less == 0 && dom_equal ~= M %which means the i-th individual is dominated by the j-th individual in at least one objective function
individual(i) = individual(i)+ 1;
break;
end
end
if individual(i) == 0
x(i,M + V + 1) = 1; %if no individuals dominate the i-th individual, than put 1 in his M+V+1-th column
end
end
toc
f=x;
end