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)
+ const std::unordered_set<kernel::routing::NetZoneImpl*>& netzones,
+ double rate)
{
std::vector<s4u::Link*> s4u_route;
std::unordered_set<s4u::NetZone*> s4u_netzones;
}
bandwidth_bound *= bw_factor;
- action->set_user_bound(get_bandwidth_constraint(action->get_user_bound(), bandwidth_bound, size));
+ /* the bandwidth is determined by the minimum between flow and user's defined rate */
+ if (rate >= 0 && rate < bandwidth_bound)
+ bandwidth_bound = rate;
+
+ action->set_user_bound(bandwidth_bound);
action->lat_current_ = action->latency_;
if (lat_factor_cb_) {
NetworkCm02Action* action = comm_action_create(src, dst, size, route, failed);
action->sharing_penalty_ = latency;
action->latency_ = latency;
- action->set_user_bound(rate);
if (sg_weight_S_parameter > 0) {
action->sharing_penalty_ =
}
/* setting bandwidth and latency bounds considering route and configured bw/lat factors */
- comm_action_set_bounds(src, dst, size, action, route, netzones);
+ comm_action_set_bounds(src, dst, size, action, route, netzones, rate);
/* creating the maxmin variable associated to this action */
comm_action_set_variable(action, route, back_route);
/** @brief Set communication bounds for latency and bandwidth */
void 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);
+ const std::unordered_set<kernel::routing::NetZoneImpl*>& netzones, double rate);
/** @brief Create maxmin variable in communication action */
void comm_action_set_variable(NetworkCm02Action* action, const std::vector<LinkImpl*>& route,
const std::vector<LinkImpl*>& back_route);
*/
virtual double get_bandwidth_factor(double /* size*/) { return sg_bandwidth_factor; }
- /**
- * @brief Get definitive bandwidth.
- * @details It gives the minimum bandwidth between the one that would occur if no limitation was enforced, and the
- * one arbitrary limited.
- * @param rate The desired maximum bandwidth.
- * @param bound The bandwidth with only the network taken into account.
- * @param size The size of the message.
- * @return The new bandwidth.
- */
- double get_bandwidth_constraint(double rate, double bound, double size) const;
-
double next_occurring_event_full(double now) override;
void set_lat_factor_cb(const std::function<NetworkFactorCb>& cb) override { THROW_UNIMPLEMENTED; }