diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2021-01-11 16:20:50 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2021-01-11 16:20:50 +0100 |
commit | 8f426980c73e1fd166cfa96e02c88e04e85a2cfa (patch) | |
tree | 72a9e84fb21f1a10c9199192ddbb76f6e29d960b /lib/model.py | |
parent | 717078e082ccdf6b0fd148f4d692307d1c6cbce7 (diff) |
evaluate E = P*t model. Seems slightly better in some cases
TODO: Fix send duration model generation for cc1200, should improve eval
Diffstat (limited to 'lib/model.py')
-rw-r--r-- | lib/model.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/model.py b/lib/model.py index 781a29c..9070ece 100644 --- a/lib/model.py +++ b/lib/model.py @@ -1132,6 +1132,22 @@ class PTAModel: ) measures = regression_measures(predicted_data, elem[key]) detailed_results[name][key] = measures + if elem["isa"] == "transition": + predicted_data = np.array( + list( + map( + lambda i: model_function( + name, "power", param=elem["param"][i] + ) + * model_function(name, "duration", param=elem["param"][i]), + range(len(elem["power"])), + ) + ) + ) + measures = regression_measures( + predicted_data, elem["power"] * elem["duration"] + ) + detailed_results[name]["energy_Pt"] = measures return {"by_name": detailed_results} |