Implement (4.) - Calculation of difference between actual route and optimal route

Overview

With #2 (closed) and #3 (closed) implemented, we have sampled points matched to traffic structures and including their timestamps as well as optimal routes between these points at hand.

Now, differences between the optimal and actual connections - as driven by the courier - of two consecutive points have to be calculated. There are two major options that should be addressed within this feature:

  1. Given two sampled points p_1 and p_2, sampled with sampling temporal_distance d and their timestamps: Calculate the difference between the time of the optimal connecting route r, and the actual time needed.

  2. Given two sampled points p_1 and p_2, sampled with sampling temporal_distance d and their timestamps: Use k \in \mathbb{N} to derive a smaller d' = d/k. Sample again (sub sampling) and calculate the optimal routes connecting points p'_{1}, \dots ,p'_{k+1}, with p'_{1} = p_1 and p'_{k+1} = p_2. Now there are three possibilities to further process these differences:

  • a. Use the difference between the sum \sum_{i=0}^{k}dist(r'_{i}) of distances of optimal routes within r' and the distance of the optimal route r.
  • b. Use the difference between the sum \sum_{i=0}^{k}dur(r'_{i}) of durations of optimal routes within r' and the duration of the optimal route r.
  • c. Use a weighting schema two derive a risk from both, difference in duration and in distance. See #9.

Deal with the following problems:

  • What if during sub sampling, we find no or only very few new points between the original two points?
    • --> Add a min number of sampled points.
    • Taken into account in implementation.
  • What if during sub sampling, we would sample away the original end point?
    • --> Explicitly keep end point and ignore potential sampled points before end point.
    • Taken into account in implementation.
Edited by Lukas Gehrke