File tree 1 file changed +15
-7
lines changed
1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 13
13
14
14
def compute (values , out ):
15
15
res = list (sorted (map (lambda x : tuple (map (int , x .split (';' ))), values .split ('|' )[:- 1 ])))
16
- cum = [None ] * len (res )
17
16
total = sum (map (lambda x : x [1 ], res ))
18
17
running_total = 0
19
18
out .write ("err cum\n " )
19
+ goal = 1
20
20
for i in range (len (res )):
21
- out .write (str (res [i ][0 ]) + " " + str (float (total - running_total ) / total ) + "\n " )
22
- cum [i ] = float (total - running_total ) / total
21
+ curr = float (total - running_total ) / total
22
+ if curr <= goal :
23
+ out .write (str (res [i ][0 ]) + " " + str (float (total - running_total ) / total ) + "\n " )
24
+ goal -= 0.01
23
25
running_total += res [i ][1 ]
26
+ # Consciously ignoring the last 1%
24
27
out .write ("\n " )
25
28
29
+ done = { }
30
+
26
31
with open (file ) as file :
27
32
lines = csv .reader (file )
28
33
for row in lines :
29
- with open (row [0 ] + "_rank_error.txt" , "w" ) as out :
30
- compute (row [5 ], out )
31
- with open (row [0 ] + "_delay.txt" , "w" ) as out :
32
- compute (row [5 ], out )
34
+ # We have enough data as-is, only use a single testrun
35
+ if row [0 ] not in done :
36
+ with open (row [0 ] + "_rank_error.txt" , "w" ) as out :
37
+ compute (row [5 ], out )
38
+ with open (row [0 ] + "_delay.txt" , "w" ) as out :
39
+ compute (row [9 ], out )
40
+ done [row [0 ]] = None
You can’t perform that action at this time.
0 commit comments