summaryrefslogtreecommitdiff
path: root/bin/analyze-archive.py
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-01-25 20:57:19 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-01-25 20:57:19 +0100
commit94622c2c44cc466a3c4137be8d35024fe1543a47 (patch)
treea49bf382913624bf23ed2f34978019d33a29e1df /bin/analyze-archive.py
parent6eabea2d52da2bc26c23453c29b7f88b4fc69cae (diff)
print model data, assess model quality
Diffstat (limited to 'bin/analyze-archive.py')
-rwxr-xr-xbin/analyze-archive.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py
index a2596d3..fcfb139 100755
--- a/bin/analyze-archive.py
+++ b/bin/analyze-archive.py
@@ -7,20 +7,24 @@ from scipy.cluster.vq import kmeans2
import struct
import sys
import tarfile
-from dfatool import Analysis, RawData
+from dfatool import EnergyModel, RawData
if __name__ == '__main__':
filename = sys.argv[1]
raw_data = RawData(filename)
preprocessed_data = raw_data.get_preprocessed_data()
- print(preprocessed_data)
- foo = Analysis(preprocessed_data)
- res = foo.analyze()
- print(res)
- for key in res.keys():
- print(key)
- for subkey in res[key].keys():
- if subkey != 'isa' and len(res[key][subkey]) > 0:
- print(' {:s}: {:f}'.format(subkey, np.mean(res[key][subkey])))
+ model = EnergyModel(preprocessed_data)
+ static_model = model.get_static()
+
+ print('--- simple static model ---')
+ for state in model.states():
+ print('{:10s}: {:.0f} µW'.format(state, static_model(state, 'power')))
+ for trans in model.transitions():
+ print('{:10s}: {:.0f} / {:.0f} / {:.0f} pJ'.format(
+ trans, static_model(trans, 'energy'),
+ static_model(trans, 'rel_energy_prev'),
+ static_model(trans, 'rel_energy_next')))
+
+ model.assess(model.get_static())
sys.exit(0)