-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdominance.h
61 lines (47 loc) · 1.44 KB
/
dominance.h
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <malloc.h>
#include "amosa.h"
/* The Following function checks whether the solution
vector func1 dominates the solution vector func2 */
int is_dominated(double *func1,double *func2, AMOSAType *amosaParams)
{
int i;
int i_count_less=0,i_count_equal=0;
double ff;
for(i=0;i<amosaParams->i_no_offunc;i++)
{
ff=(func1[i]-func2[i]);
if(func1[i]<func2[i])
i_count_less++;
else if(func1[i]==func2[i])
i_count_equal++;
}
if(((i_count_less+i_count_equal)==amosaParams->i_no_offunc) && i_count_less>0)
return(TRUE);
else
return(FALSE);
}
/* The Following function calculates the unsigned amount of domination between two solution vectors func1 and func2*/
double find_unsign_dom(double *func1,double *func2, AMOSAType *amosaParams)
{
int i;
double d_dominance=1;
for(i=0;i<amosaParams->i_no_offunc;i++)
{
if((func1[i]-func2[i])!=0.0)
d_dominance=d_dominance*fabs(func1[i]-func2[i])/amosaParams->d_func_range[i];
}
return(d_dominance);
}
/* The Following function calculates the signed amount of domination
between two solution vectors func1 and func2 */
double find_sign_dom(double *func1,double *func2, AMOSAType *amosaParams)
{
int i;
double d_dominance=1;
for(i=0;i<amosaParams->i_no_offunc;i++)
{
if(fabs(func1[i]-func2[i])!=0)
d_dominance=d_dominance*(func1[i]-func2[i])/amosaParams->d_func_range[i];
}
return(d_dominance);
}