Skip to content

Add a DynamicDeviceEnergyModel

I created a DynamicDeviceEnergyModel which allows easier energy consumption modeling for devices that don't have any class directly supporting them (for example the energy consumption of an MCU). This is a DeviceEnergyModel that is installed on a node directly and leaves a lot of responsibility to the user. The creation of states (for example Idle, Sleep, Extra1, Extra2, Special) has to be done by the user (except for the Off state). The same is the case for changing states, which has to be configured by the user as well.

This class is used together with an instance of DynamicEnergyModelStates which contains the different states (index, name, current in A) that the user defined in their script. Using the index, the user can then set up manual or automatic (for example using callbacks of other classes) state changes by referring to the state's index.
I created this class to allow for energy consumption modeling of complicated devices that cannnot be modeled that easy - as it is also allowed with the SimpleDeviceEnergyModel - , while being a bit easier to debug and set up then the SimpleDeviceEnergyModel. This also includes basic callbacks and TracedValues.

As of right now, no tests or examples for this are available. However, I am planning on adding a simple example of an MCU's energy consumption being modeled using this class. I added one small example to show how this class works. If any more examples or tests are required or wanted, I can add some.


This code was created as part of my Bachelor Thesis at the Research Group of Connected and Mobile Systems at the Institute of Operating Systems and Computer Networks (IBR) at the Technische Universität Braunschweig.

Edited by Philip Hönnecke

Merge request reports