summaryrefslogtreecommitdiff
path: root/bin/analyze-archive.py
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-02-12 15:47:11 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-02-12 16:30:18 +0100
commit7c26be2cad657e9a08e229bb541a7d926079f6a9 (patch)
tree78513adb07d5d1ffa38e4370c99e83f31383bad9 /bin/analyze-archive.py
parent5ddb53dbc414ebb441cc44ac00a91b9ec3d40285 (diff)
determine functions for parameter-dependent model attributes
Diffstat (limited to 'bin/analyze-archive.py')
-rwxr-xr-xbin/analyze-archive.py59
1 files changed, 35 insertions, 24 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py
index e5f3783..81d6f54 100755
--- a/bin/analyze-archive.py
+++ b/bin/analyze-archive.py
@@ -10,31 +10,42 @@ if __name__ == '__main__':
preprocessed_data = raw_data.get_preprocessed_data()
model = EnergyModel(preprocessed_data)
- print('--- simple static model ---')
- static_model = model.get_static()
+ #print('--- simple static model ---')
+ #static_model = model.get_static()
+ #for state in model.states():
+ # print('{:10s}: {:.0f} µW ({:.2f})'.format(
+ # state,
+ # static_model(state, 'power'),
+ # model.generic_param_dependence_ratio(state, 'power')))
+ # for param in model.parameters():
+ # print('{:10s} dependence on {:15s}: {:.2f}'.format(
+ # '',
+ # param,
+ # model.param_dependence_ratio(state, 'power', param)))
+ #for trans in model.transitions():
+ # print('{:10s}: {:.0f} / {:.0f} / {:.0f} pJ ({:.2f} / {:.2f} / {:.2f})'.format(
+ # trans, static_model(trans, 'energy'),
+ # static_model(trans, 'rel_energy_prev'),
+ # static_model(trans, 'rel_energy_next'),
+ # model.generic_param_dependence_ratio(trans, 'energy'),
+ # model.generic_param_dependence_ratio(trans, 'rel_energy_prev'),
+ # model.generic_param_dependence_ratio(trans, 'rel_energy_next')))
+ # print('{:10s}: {:.0f} µs'.format(trans, static_model(trans, 'duration')))
+ #model.assess(static_model)
+
+ #print('--- LUT ---')
+ #lut_model = model.get_param_lut()
+ #model.assess(lut_model)
+
+ print('--- param model ---')
+ param_model, param_info = model.get_fitted()
for state in model.states():
- print('{:10s}: {:.0f} µW ({:.2f})'.format(
- state,
- static_model(state, 'power'),
- model.generic_param_dependence_ratio(state, 'power')))
- for param in model.parameters():
- print('{:10s} dependence on {:15s}: {:.2f}'.format(
- '',
- param,
- model.param_dependence_ratio(state, 'power', param)))
+ for attribute in ['power']:
+ if param_info(state, attribute):
+ print('{:10s}: {}'.format(state, param_info(state, attribute)['function']._model_str))
for trans in model.transitions():
- print('{:10s}: {:.0f} / {:.0f} / {:.0f} pJ ({:.2f} / {:.2f} / {:.2f})'.format(
- trans, static_model(trans, 'energy'),
- static_model(trans, 'rel_energy_prev'),
- static_model(trans, 'rel_energy_next'),
- model.generic_param_dependence_ratio(trans, 'energy'),
- model.generic_param_dependence_ratio(trans, 'rel_energy_prev'),
- model.generic_param_dependence_ratio(trans, 'rel_energy_next')))
- print('{:10s}: {:.0f} µs'.format(trans, static_model(trans, 'duration')))
- model.assess(static_model)
-
- print('--- LUT ---')
- lut_model = model.get_param_lut()
- model.assess(lut_model)
+ for attribute in ['energy', 'rel_energy_prev', 'rel_energy_next', 'duration', 'timeout']:
+ if param_info(trans, attribute):
+ print('{:10s}: {:10s}: {}'.format(trans, attribute, param_info(trans, attribute)['function']._model_str))
sys.exit(0)