+ return failed;
+}
+
+void NetworkCm02Model::comm_action_set_bounds(const s4u::Host* src, const s4u::Host* dst, double size,
+ NetworkCm02Action* action, const std::vector<LinkImpl*>& route,
+ const std::unordered_set<kernel::routing::NetZoneImpl*>& netzones)
+{
+ std::vector<s4u::Link*> s4u_route;
+ std::unordered_set<s4u::NetZone*> s4u_netzones;
+
+ /* transform data to user structures if necessary */
+ if (lat_factor_cb_ || bw_factor_cb_) {
+ std::for_each(route.begin(), route.end(), [&s4u_route](LinkImpl* l) { s4u_route.push_back(l->get_iface()); });
+ std::for_each(netzones.begin(), netzones.end(),
+ [&s4u_netzones](kernel::routing::NetZoneImpl* n) { s4u_netzones.insert(n->get_iface()); });
+ }
+ double bw_factor;
+ if (bw_factor_cb_) {
+ bw_factor = bw_factor_cb_(size, src, dst, s4u_route, s4u_netzones);
+ } else {
+ bw_factor = get_bandwidth_factor(size);
+ }
+ /* get mininum bandwidth among links in the route and multiply by correct factor */
+ const auto& min_bw = std::min_element(
+ route.begin(), route.end(), [](const auto& a, const auto& b) { return a->get_bandwidth() < b->get_bandwidth(); });