#ifndef NETWORK_INTERFACE_CPP_
#define NETWORK_INTERFACE_CPP_
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_network, ker_resource, "Network resources, that fuels communications");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_network, ker_resource, "Network resources, that fuel communications");
/*********
* Model *
return minRes;
}
+double NetworkModel::get_bandwidth_constraint(double rate, double bound, double size)
+{
+ return rate < 0 ? bound : std::min(bound, rate);
+}
+
/************
* Resource *
************/
if (name != "__loopback__")
xbt_assert(not s4u::Link::by_name_or_null(name), "Link '%s' declared several times in the platform.", name.c_str());
- latency_.scale = 1;
- bandwidth_.scale = 1;
-
s4u::Engine::get_instance()->link_register(name, &piface_);
XBT_DEBUG("Create link '%s'", name.c_str());
}
void LinkImpl::seal()
{
+ if (is_sealed())
+ return;
+
xbt_assert(this->get_model(), "Cannot seal Link(%s) without setting the Network model first", this->get_cname());
Resource::seal();
s4u::Link::on_creation(piface_);