/** Unblock the progression of this activity if it was suspended previously */
virtual Activity* resume();
/** Whether or not the progression of this activity is blocked */
- bool is_suspended() { return suspended_; }
+ bool is_suspended() const { return suspended_; }
virtual const char* get_cname() const = 0;
virtual const std::string& get_name() const = 0;
* location of hosts into account, or even to model mobility in your SimGrid simulation.
*
* Note that this function asserts that the link is actually a wifi link */
- void set_host_wifi_rate(s4u::Host* host, int level);
+ void set_host_wifi_rate(const s4u::Host* host, int level) const;
/** @brief Returns the current load (in bytes per second) */
double get_usage() const;
return this->pimpl_->get_sharing_policy();
}
-void Link::set_host_wifi_rate(s4u::Host* host, int level)
+void Link::set_host_wifi_rate(const s4u::Host* host, int level) const
{
xbt_assert(pimpl_->get_sharing_policy() == Link::SharingPolicy::WIFI, "Link %s does not seem to be a wifi link.",
get_cname());
simgrid::s4u::this_actor::get_host()->get_cname(), dest, end_time - start_time);
});
simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name(dest), [mailbox]() { mailbox->get(); });
- auto* ap1 = simgrid::s4u::Link::by_name("AP1");
+ const auto* ap1 = simgrid::s4u::Link::by_name("AP1");
ap1->set_host_wifi_rate(simgrid::s4u::Host::by_name(src), 0);
ap1->set_host_wifi_rate(simgrid::s4u::Host::by_name(dest), 0);
simgrid::s4u::this_actor::sleep_for(10);