do {
pred = TO_FLOYD_PRED(src->id(), cur);
if (pred == -1)
- THROWF(arg_error, 0, "No route from '%s' to '%s'", src->name(), dst->name());
+ THROWF(arg_error, 0, "No route from '%s' to '%s'", src->name().c_str(), dst->name().c_str());
route_stack.push_back(TO_FLOYD_LINK(pred, cur));
cur = pred;
} while (cur != src->id());
while (!route_stack.empty()) {
sg_platf_route_cbarg_t e_route = route_stack.back();
route_stack.pop_back();
- if (hierarchy_ == RoutingMode::recursive && prev_dst_gw != nullptr && strcmp(prev_dst_gw->name(), e_route->gw_src->name())) {
+ if (hierarchy_ == RoutingMode::recursive && prev_dst_gw != nullptr &&
+ strcmp(prev_dst_gw->name().c_str(), e_route->gw_src->name().c_str())) {
routing_platf->getRouteAndLatency(prev_dst_gw, e_route->gw_src, route->link_list, lat);
}
for (auto link: *e_route->link_list) {
route->link_list->push_back(link);
if (lat)
- *lat += link->getLatency();
+ *lat += link->latency();
}
prev_dst_gw = e_route->gw_dst;
/* Check that the route does not already exist */
if (route->gw_dst) // AS route (to adapt the error message, if any)
xbt_assert(nullptr == TO_FLOYD_LINK(route->src->id(), route->dst->id()),
- "The route between %s@%s and %s@%s already exists (Rq: routes are symmetrical by default).",
- route->src->name(),route->gw_src->name(),route->dst->name(),route->gw_dst->name());
+ "The route between %s@%s and %s@%s already exists (Rq: routes are symmetrical by default).",
+ route->src->name().c_str(), route->gw_src->name().c_str(), route->dst->name().c_str(),
+ route->gw_dst->name().c_str());
else
xbt_assert(nullptr == TO_FLOYD_LINK(route->src->id(), route->dst->id()),
- "The route between %s and %s already exists (Rq: routes are symmetrical by default).", route->src->name(),route->dst->name());
+ "The route between %s and %s already exists (Rq: routes are symmetrical by default).",
+ route->src->name().c_str(), route->dst->name().c_str());
TO_FLOYD_LINK(route->src->id(), route->dst->id()) = newExtendedRoute(hierarchy_, route, 1);
TO_FLOYD_PRED(route->src->id(), route->dst->id()) = route->src->id();
if (route->symmetrical == true) {
if (route->gw_dst) // AS route (to adapt the error message, if any)
- xbt_assert(nullptr == TO_FLOYD_LINK(route->dst->id(), route->src->id()),
+ xbt_assert(
+ nullptr == TO_FLOYD_LINK(route->dst->id(), route->src->id()),
"The route between %s@%s and %s@%s already exists. You should not declare the reverse path as symmetrical.",
- route->dst->name(),route->gw_dst->name(),route->src->name(),route->gw_src->name());
+ route->dst->name().c_str(), route->gw_dst->name().c_str(), route->src->name().c_str(),
+ route->gw_src->name().c_str());
else
xbt_assert(nullptr == TO_FLOYD_LINK(route->dst->id(), route->src->id()),
- "The route between %s and %s already exists. You should not declare the reverse path as symmetrical.",
- route->dst->name(),route->src->name());
+ "The route between %s and %s already exists. You should not declare the reverse path as symmetrical.",
+ route->dst->name().c_str(), route->src->name().c_str());
if(route->gw_dst && route->gw_src) {
NetCard* gw_tmp = route->gw_src;
}
if(!route->gw_src && !route->gw_dst)
- XBT_DEBUG("Load Route from \"%s\" to \"%s\"", route->dst->name(), route->src->name());
+ XBT_DEBUG("Load Route from \"%s\" to \"%s\"", route->dst->name().c_str(), route->src->name().c_str());
else
- XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", route->dst->name(),
- route->gw_src->name(), route->src->name(), route->gw_dst->name());
+ XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", route->dst->name().c_str(), route->gw_src->name().c_str(),
+ route->src->name().c_str(), route->gw_dst->name().c_str());
TO_FLOYD_LINK(route->dst->id(), route->src->id()) = newExtendedRoute(hierarchy_, route, 0);
TO_FLOYD_PRED(route->dst->id(), route->src->id()) = route->dst->id();
}
/* Add the loopback if needed */
- if (routing_platf->loopback_ && hierarchy_ == RoutingMode::base) {
+ if (surf_network_model->loopback_ && hierarchy_ == RoutingMode::base) {
for (unsigned int i = 0; i < table_size; i++) {
sg_platf_route_cbarg_t e_route = TO_FLOYD_LINK(i, i);
if (!e_route) {
e_route->gw_src = nullptr;
e_route->gw_dst = nullptr;
e_route->link_list = new std::vector<Link*>();
- e_route->link_list->push_back(routing_platf->loopback_);
+ e_route->link_list->push_back(surf_network_model->loopback_);
TO_FLOYD_LINK(i, i) = e_route;
TO_FLOYD_PRED(i, i) = i;
TO_FLOYD_COST(i, i) = 1;