diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-06-25 15:35:29 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-06-25 15:35:29 +0000 |
commit | 9f4e26c9067eb5771b7dbcb2a672d685e559f1f7 (patch) | |
tree | 5a04682ceaad090f49413aecbe40e0750360fd8d /src/ats | |
parent | 678fae38a93164db4b1c51127a5d9382d4d7a861 (diff) | |
download | gnunet-9f4e26c9067eb5771b7dbcb2a672d685e559f1f7.tar.gz gnunet-9f4e26c9067eb5771b7dbcb2a672d685e559f1f7.zip |
forgotten commit making penalty quadratic as used and documented
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/plugin_ats_ril.c | 8 |
1 files 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) | |||
1047 | over_in = net->bw_in_utilized - net->bw_in_available; | 1047 | over_in = net->bw_in_utilized - net->bw_in_available; |
1048 | if (RIL_ACTION_BW_IN_INC == agent->a_old) | 1048 | if (RIL_ACTION_BW_IN_INC == agent->a_old) |
1049 | { | 1049 | { |
1050 | over_in *= 2; | 1050 | /* increase quadratically */ |
1051 | over_in *= over_in; | ||
1051 | } | 1052 | } |
1052 | } | 1053 | } |
1053 | if (net->bw_out_utilized > net->bw_out_available) | 1054 | 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) | |||
1055 | over_out = net->bw_out_utilized - net->bw_out_available; | 1056 | over_out = net->bw_out_utilized - net->bw_out_available; |
1056 | if (RIL_ACTION_BW_OUT_INC == agent->a_old) | 1057 | if (RIL_ACTION_BW_OUT_INC == agent->a_old) |
1057 | { | 1058 | { |
1058 | over_out *= 2; | 1059 | /* increase quadratically */ |
1060 | over_out *= over_out; | ||
1059 | } | 1061 | } |
1060 | } | 1062 | } |
1061 | over_max = (over_in + over_out) / RIL_MIN_BW; | 1063 | over_max = (over_in + over_out) / (RIL_MIN_BW * RIL_MIN_BW); |
1062 | 1064 | ||
1063 | return -1.0 * (double) over_max; | 1065 | return -1.0 * (double) over_max; |
1064 | } | 1066 | } |