Boavizta / boaviztapi

🛠 Giving access to BOAVIZTA reference data and methodologies trough a RESTful API
GNU Affero General Public License v3.0
66 stars 23 forks source link

Smart-complete electrical_consumption with consumption_profil(), multiple workload #88

Closed da-ekchajzer closed 1 year ago

da-ekchajzer commented 2 years ago

Problem

In some cases my device will run at different level of workload for a given amount of time

I want to smart-complete the hour_electrical_consumption given a set of (workload, `time) knowing the consumption_profil of my device.

Solution

Input data :

"usage":{
 "workload": {
     "10":0.2,
     "20":0.1,
     ....
     "Workload(%)":ratio_of_time_at_this_workload
}
"consumption_profile":"Skylake"
}

sum(ratio_of_time_at_this_workload) = 1

We should use consumption_profil() function created in #86 :

hour_electrical_consumption = SUM(consumption_profil(Workload(%))*ratio_of_time_at_this_workload)

da-ekchajzer commented 1 year ago

Implemented for CPU in https://github.com/Boavizta/boaviztapi/pull/113