} 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(); });
-
- double bandwidth_bound = min_bw == route.end() ? -1.0 : bw_factor * (*min_bw)->get_bandwidth();
-
- if (bw_constraint_cb_) {
- action->set_user_bound(
- bw_constraint_cb_(action->get_user_bound(), bandwidth_bound, size, src, dst, s4u_route, s4u_netzones));
- } else {
- action->set_user_bound(get_bandwidth_constraint(action->get_user_bound(), bandwidth_bound, size));
+ /* get mininum bandwidth among links in the route and multiply by correct factor
+ * ignore wi-fi links, they're not considered for bw_factors */
+ double bandwidth_bound = -1.0;
+ for (const auto* l : route) {
+ if (l->get_sharing_policy() == s4u::Link::SharingPolicy::WIFI)
+ continue;
+ if (bandwidth_bound == -1.0 || l->get_bandwidth() < bandwidth_bound)
+ bandwidth_bound = l->get_bandwidth();
}
+ bandwidth_bound *= bw_factor;
+
+ action->set_user_bound(get_bandwidth_constraint(action->get_user_bound(), bandwidth_bound, size));
action->lat_current_ = action->latency_;
if (lat_factor_cb_) {
* @param size The size of the message.
* @return The new bandwidth.
*/
- virtual double get_bandwidth_constraint(double rate, double /*bound*/, double /*size*/) { return rate; }
+ double get_bandwidth_constraint(double rate, double bound, double size);
double next_occurring_event_full(double now) override;
double get_latency_factor(double size) override;
double get_bandwidth_factor(double size) override;
- double get_bandwidth_constraint(double rate, double bound, double size) override;
protected:
virtual void check_lat_factor_cb() override;