-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresult_tuple.py
33 lines (29 loc) · 1.02 KB
/
result_tuple.py
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
"""
Provides output data structure for algorithms.
"""
class ResultTuple:
"""
Single line of results of any algorithm.
"""
def __init__(self, frames: int, total_mem_access: int, page_faults: int, writes: int, refresh_rate):
self.frames = frames
self.total_mem_access = total_mem_access
self.page_faults = page_faults
self.writes = writes
self.refresh = refresh_rate
def get_result(self, alg: str, trace_file: str, total_time):
"""
Adds additional (general) parameters to the result tuple.
:param alg: algorithm name
:param trace_file: name of file that was used as data source
:param total_time: total algorithm execution time in miliseconds
:return: a line to be written into CSV
"""
return (alg,
trace_file,
self.frames,
self.total_mem_access,
self.page_faults,
self.writes,
self.refresh,
total_time)