From 9f4e26c9067eb5771b7dbcb2a672d685e559f1f7 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Wed, 25 Jun 2014 15:35:29 +0000 Subject: [PATCH] forgotten commit making penalty quadratic as used and documented --- src/ats/plugin_ats_ril.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ats/plugin_ats_ril.c b/src/ats/plugin_ats_ril.c index 03bddad50..35812029c 100644 --- a/src/ats/plugin_ats_ril.c +++ b/src/ats/plugin_ats_ril.c @@ -1047,7 +1047,8 @@ envi_get_penalty (struct GAS_RIL_Handle *solver, struct RIL_Peer_Agent *agent) over_in = net->bw_in_utilized - net->bw_in_available; if (RIL_ACTION_BW_IN_INC == agent->a_old) { - over_in *= 2; + /* increase quadratically */ + over_in *= over_in; } } if (net->bw_out_utilized > net->bw_out_available) @@ -1055,10 +1056,11 @@ envi_get_penalty (struct GAS_RIL_Handle *solver, struct RIL_Peer_Agent *agent) over_out = net->bw_out_utilized - net->bw_out_available; if (RIL_ACTION_BW_OUT_INC == agent->a_old) { - over_out *= 2; + /* increase quadratically */ + over_out *= over_out; } } - over_max = (over_in + over_out) / RIL_MIN_BW; + over_max = (over_in + over_out) / (RIL_MIN_BW * RIL_MIN_BW); return -1.0 * (double) over_max; } -- 2.25.1