- if (sg_weight_S_parameter > 0) {
- action->sharing_penalty_ =
- std::accumulate(route.begin(), route.end(), action->sharing_penalty_, [](double total, LinkImpl* const& link) {
- return total + sg_weight_S_parameter / link->get_bandwidth();
- });
+ return action;
+}
+
+bool NetworkCm02Model::comm_get_route_info(const s4u::Host* src, const s4u::Host* dst, double& latency,
+ std::vector<LinkImpl*>& route, std::vector<LinkImpl*>& back_route,
+ std::unordered_set<kernel::routing::NetZoneImpl*>& netzones) const
+{
+ kernel::routing::NetZoneImpl::get_global_route_with_netzones(src->get_netpoint(), dst->get_netpoint(), route,
+ &latency, netzones);
+
+ xbt_assert(not route.empty() || latency > 0,
+ "You're trying to send data from %s to %s but there is no connecting path between these two hosts.",
+ src->get_cname(), dst->get_cname());
+
+ bool failed = std::any_of(route.begin(), route.end(), [](const LinkImpl* link) { return not link->is_on(); });
+
+ if (cfg_crosstraffic) {
+ dst->route_to(src, back_route, nullptr);
+ if (not failed)
+ failed =
+ std::any_of(back_route.begin(), back_route.end(), [](const LinkImpl* link) { return not link->is_on(); });