Newer
Older
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import java.io.*;
public class PerfCompare
{
private static String[] names = {
"perf_iut_amphi1.txt",
"perf_iut_amphi2.txt",
"perf_iut_corridor1.txt",
"perf_iut_corridor2.txt",
"perf_iut_entrance.txt",
"perf_iut_labo1.txt",
"perf_iut_labo2.txt",
"perf_iut_library1.txt",
"perf_iut_mul1.txt",
"perf_iut_mul2.txt",
"perf_iut_office1.txt",
"perf_iut_office2.txt",
"perf_iut_office4.txt",
"perf_iut_outdoor1.txt",
"perf_iut_outdoor2.txt",
"perf_iut_outdoor3.txt",
"perf_iut_scc1.txt",
"perf_iut_scc2.txt",
"perf_iut_scc3.txt",
"perf_loria_indoor1.txt",
"perf_loria_indoor2.txt",
"perf_loria_indoor3.txt",
"perf_loria_office1.txt",
"perf_loria_outdoor1.txt",
"perf_vosges_castle1.txt",
"perf_vosges_castle2.txt",
"perf_vosges_corridor1.txt",
"perf_vosges_detail1.txt",
"perf_vosges_detail2.txt",
"perf_vosges_detail3.txt"};
private double timeRatio = 0.;
private double countRatio = 0.;
private double longRatio = 0.;
private double lengthRatio = 0.;
private double widthRatio = 0.;
public static void main (String[] args) throws IOException
{
PerfCompare[] perf = new PerfCompare[names.length];
double meanTime = 0.;
double meanCount = 0.;
double meanLong = 0.;
double meanLength = 0.;
double meanWidth = 0.;
for (int i = 0; i < names.length; i++)
{
perf[i] = new PerfCompare (names[i]);
meanTime += perf[i].timeRatio;
meanCount += perf[i].countRatio;
meanLong += perf[i].longRatio;
meanLength += perf[i].lengthRatio;
meanWidth += perf[i].widthRatio;
}
meanTime /= names.length;
meanCount /= names.length;
meanLong /= names.length;
meanLength /= names.length;
meanWidth /= names.length;
double sdTime = 0.;
double sdCount = 0.;
double sdLong = 0.;
double sdLength = 0.;
double sdWidth = 0.;
for (int i = 0; i < names.length; i++)
{
sdTime += (perf[i].timeRatio - meanTime)
* (perf[i].timeRatio - meanTime);
sdCount += (perf[i].countRatio - meanCount)
* (perf[i].countRatio - meanCount);
sdLong += (perf[i].longRatio - meanLong)
* (perf[i].longRatio - meanLong);
sdLength += (perf[i].lengthRatio - meanLength)
* (perf[i].lengthRatio - meanLength);
sdWidth += (perf[i].widthRatio - meanWidth)
* (perf[i].widthRatio - meanWidth);
}
sdTime = Math.sqrt (sdTime / names.length);
sdCount = Math.sqrt (sdCount / names.length);
sdLong = Math.sqrt (sdLong / names.length);
sdLength = Math.sqrt (sdLength / names.length);
sdWidth = Math.sqrt (sdWidth / names.length);
System.out.println ("Time : " + meanTime + " (" + sdTime + ")");
System.out.println ("Count : " + meanCount + " (" + sdCount + ")");
System.out.println ("Long : " + meanLong + " (" + sdLong + ")");
System.out.println ("Lendth : " + meanLength + " (" + sdLength + ")");
System.out.println ("Width : " + meanWidth + " (" + sdWidth + ")");
}
public PerfCompare (String name) throws IOException
{
BufferedReader flot = new BufferedReader (new FileReader (name));
String val = flot.readLine (); // nb runs
val = flot.readLine (); // width
val = flot.readLine (); // height
val = flot.readLine (); // time
double t1 = (new Double (val)).doubleValue ();
val = flot.readLine (); // trials
val = flot.readLine (); // count of segments
int ns1 = (new Integer (val)).intValue ();
val = flot.readLine (); // count of long segments
int nl1 = (new Integer (val)).intValue ();
val = flot.readLine (); // mean length
double l1 = (new Double (val)).doubleValue ();
val = flot.readLine (); // mean width
double w1 = (new Double (val)).doubleValue ();
val = flot.readLine (); // mean width of long segments
val = flot.readLine (); // time
double t2 = (new Double (val)).doubleValue ();
val = flot.readLine (); // trials
val = flot.readLine (); // count of segments
int ns2 = (new Integer (val)).intValue ();
val = flot.readLine (); // count of long segments
int nl2 = (new Integer (val)).intValue ();
val = flot.readLine (); // mean length
double l2 = (new Double (val)).doubleValue ();
val = flot.readLine (); // mean width
double w2 = (new Double (val)).doubleValue ();
val = flot.readLine (); // mean width of long segments
flot.close ();
timeRatio = t1 / t2;
countRatio = ns1 / (double) ns2;
longRatio = nl1 / (double) nl2;
lengthRatio = l1 / l2;
widthRatio = w1 / w2;
}
}