Commit 7e2daa08 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Fix computation of exponential decay in route_smoothed_metric.

We're working with deltas, not with absolute values, so we need to
subtract 1.  Oh, and it's multiplication, not division.
parent 746af3cf
...@@ -627,7 +627,7 @@ route_smoothed_metric(struct babel_route *route) ...@@ -627,7 +627,7 @@ route_smoothed_metric(struct babel_route *route)
while(route->smoothed_metric_time < now.tv_sec) { while(route->smoothed_metric_time < now.tv_sec) {
diff = metric - route->smoothed_metric; diff = metric - route->smoothed_metric;
route->smoothed_metric += route->smoothed_metric +=
roughly(diff) / two_to_the_one_over_hl / 0x10000; roughly(diff) * (two_to_the_one_over_hl - 0x10000) / 0x10000;
route->smoothed_metric_time++; route->smoothed_metric_time++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment