#include <algorithm>
+#include "simgrid/Exception.hpp"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Link.hpp"
#include "simgrid/sg_config.hpp"
#include "src/surf/network_interface.hpp"
#include "src/surf/network_wifi.hpp"
#include "xbt/log.h"
+#include "xbt/parse_units.hpp"
namespace simgrid {
return this;
}
+Link* Link::set_latency(const std::string& value)
+{
+ double d_value = 0.0;
+ try {
+ d_value = xbt_parse_get_time("", 0, value.c_str(), nullptr, "");
+ } catch (const simgrid::ParseError&) {
+ throw std::invalid_argument(std::string("Impossible to set latency for link: ") + get_name() +
+ std::string(". Invalid value: ") + value);
+ }
+ return set_latency(d_value);
+}
+
double Link::get_bandwidth() const
{
return this->pimpl_->get_bandwidth();
return this;
}
+Link* Link::set_sharing_policy(Link::SharingPolicy policy)
+{
+ kernel::actor::simcall([this, policy] { pimpl_->set_sharing_policy(policy); });
+ return this;
+}
Link::SharingPolicy Link::get_sharing_policy() const
{
return this->pimpl_->get_sharing_policy();