s4u::Link::SharingPolicy policy)
{
if (policy == s4u::Link::SharingPolicy::WIFI)
- return new NetworkWifiLink(name, bandwidths, get_maxmin_system());
+ return (new NetworkWifiLink(name, bandwidths, get_maxmin_system()))->set_model(this);
xbt_assert(bandwidths.size() == 1, "Non-WIFI links must use only 1 bandwidth.");
- return new NetworkCm02Link(name, bandwidths[0], policy, get_maxmin_system());
+ return (new NetworkCm02Link(name, bandwidths[0], policy, get_maxmin_system()))->set_model(this);
}
void NetworkCm02Model::update_actions_state_lazy(double now, double /*delta*/)
************/
NetworkCm02Link::NetworkCm02Link(const std::string& name, double bandwidth, s4u::Link::SharingPolicy policy,
kernel::lmm::System* system)
- : LinkImpl(name, system->constraint_new(this, sg_bandwidth_factor * bandwidth))
+ : LinkImpl(name)
{
bandwidth_.scale = 1.0;
bandwidth_.peak = bandwidth;
+ this->set_constraint(system->constraint_new(this, sg_bandwidth_factor * bandwidth));
if (policy == s4u::Link::SharingPolicy::FATPIPE)
get_constraint()->unshare();