*/
void init_watts_range_list();
- double get_consumed_energy(void) { return eDyn_ + eStat_; }
+ double get_consumed_energy(void) const { return eDyn_ + eStat_; }
/** Get the dynamic part of the energy for this link */
- double get_energy_dynamic(void) { return eDyn_; }
- double get_energy_static(void) { return eStat_; }
- double get_duration_comm(void) { return dur_TxRx_; }
- double get_duration_idle(void) { return dur_idle_; }
+ 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; }
void LinkEnergyWifi::update_destroy()
{
- simgrid::kernel::resource::NetworkWifiLink* wifi_link =
- static_cast<simgrid::kernel::resource::NetworkWifiLink*>(link_->get_impl());
+ auto const* wifi_link = static_cast<simgrid::kernel::resource::NetworkWifiLink*>(link_->get_impl());
double duration = surf_get_clock() - prev_update_;
prev_update_ = surf_get_clock();
if(duration < 1e-6)
return;
- simgrid::kernel::resource::NetworkWifiLink* wifi_link =
- static_cast<simgrid::kernel::resource::NetworkWifiLink*>(link_->get_impl());
+ auto const* wifi_link = static_cast<simgrid::kernel::resource::NetworkWifiLink*>(link_->get_impl());
const kernel::lmm::Variable* var;
const kernel::lmm::Element* elem = nullptr;
refresh_decay_bandwidths();
}
-double NetworkWifiLink::get_host_rate(const s4u::Host* host)
+double NetworkWifiLink::get_host_rate(const s4u::Host* host) const
{
- std::map<xbt::string, int>::iterator host_rates_it;
- host_rates_it = host_rates_.find(host->get_name());
+ auto host_rates_it = host_rates_.find(host->get_name());
if (host_rates_it == host_rates_.end())
return -1;
return s4u::Link::SharingPolicy::WIFI;
}
-int NetworkWifiLink::get_host_count()
+int NetworkWifiLink::get_host_count() const
{
return host_rates_.size();
}
void set_host_rate(const s4u::Host* host, int rate_level);
/** @brief Get the AP rate associated to the host (or -1 if not associated to the AP) */
- double get_host_rate(const s4u::Host* host);
+ double get_host_rate(const s4u::Host* host) const;
s4u::Link::SharingPolicy get_sharing_policy() const override;
void apply_event(kernel::profile::Event*, double) override { THROW_UNIMPLEMENTED; }
void set_latency(double) override { THROW_UNIMPLEMENTED; }
void refresh_decay_bandwidths();
bool toggle_decay_model();
- int get_host_count();
+ int get_host_count() const;
};
class NetworkWifiAction : public NetworkCm02Action {