+
+public:
+ static xbt::Extension<simgrid::s4u::Link, LinkEnergyWifi> EXTENSION_ID;
+
+ explicit LinkEnergyWifi(s4u::Link* ptr) : link_(ptr) {}
+ LinkEnergyWifi() = delete;
+
+ /** Update the energy consumed by link_ when transmissions start or end */
+ void update();
+
+ /** Update the energy consumed when link_ is destroyed */
+ void update_destroy();
+
+ /**
+ * Fetches energy consumption values from the platform file.
+ * The user can specify:
+ * - wifi_watt_values: energy consumption in each state (IDLE:Tx:Rx:SLEEP)
+ * default: 0.82:1.14:0.94:0.10
+ * - controlDuration: duration of active beacon transmissions per second
+ * default: 0.0036
+ */
+ void init_watts_range_list();
+
+ double get_consumed_energy(void) const { return eDyn_ + eStat_; }
+ /** Get the dynamic part of the energy for this link */
+ double get_energy_dynamic(void) const { return eDyn_; }
+ double get_energy_static(void) const { return eStat_; }
+ double get_duration_comm(void) const { return dur_TxRx_; }
+ double get_duration_idle(void) const { return dur_idle_; }
+
+ /** Set the power consumed by this link while idle */
+ void set_power_idle(double value) { pIdle_ = value; }
+ /** Set the power consumed by this link while transmitting */
+ void set_power_tx(double value) { pTx_ = value; }
+ /** Set the power consumed by this link while receiving */
+ void set_power_rx(double value) { pRx_ = value; }
+ /** Set the power consumed by this link while sleeping */
+ void set_power_sleep(double value) { pSleep_ = value; }