-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDetermineDomination.m
47 lines (33 loc) · 936 Bytes
/
DetermineDomination.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
37
38
39
40
41
42
43
44
45
46
47
function pop = DetermineDomination(pop)
nPop = numel(pop);
for i = 1:nPop
pop(i).IsDominated = false;
end
% for the pop 2:nPop-1
for i = 1:nPop-1
if any(pop(i).Cost == Inf)
pop(i).IsDominated = true;
end
for j = i+1:nPop
if Dominates(pop(i), pop(j))
pop(j).IsDominated = true;
end
if Dominates(pop(j), pop(i))
pop(i).IsDominated = true;
end
end
end
% for the end pop
if any(pop(end).Cost == Inf)
pop(end).IsDominated = true;
end
for j = 1:nPop-1
if Dominates(pop(end), pop(j))
pop(j).IsDominated = true;
end
if Dominates(pop(j), pop(end))
pop(end).IsDominated = true;
break;
end
end
end