diff options
author | mvglasow <michael -at- vonglasow.com> | 2018-09-29 16:47:41 +0300 |
---|---|---|
committer | mvglasow <michael -at- vonglasow.com> | 2018-09-29 17:26:45 +0300 |
commit | 3c94452c687094b54add1e415fd17ee161d796bf (patch) | |
tree | 6944c9cbe013a21b77b138a8881e2b4d01ecc6ad | |
parent | b6c71a9ff9042e45d8acaa0ea08db6e0177bcf77 (diff) | |
download | navit-3c94452c687094b54add1e415fd17ee161d796bf.tar.gz |
Fix:route:Fix endpoint candidate handling in LPA*
Signed-off-by: mvglasow <michael -at- vonglasow.com>
-rw-r--r-- | navit/route.c | 5 | ||||
-rw-r--r-- | navit/route_protected.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/navit/route.c b/navit/route.c index 1100ac31b..8cb63a30c 100644 --- a/navit/route.c +++ b/navit/route.c @@ -1410,6 +1410,7 @@ static void route_graph_init(struct route_graph *this, struct route_info *dst, s if (val != INT_MAX) { val = val*(100-dst->percent)/100; s->end->seg = s; + s->end->dst_seg = s; s->end->rhs = val; s->end->dst_val = val; s->end->el = fh_insertkey(this->heap, MIN(s->end->rhs, s->end->value), s->end); @@ -1418,6 +1419,7 @@ static void route_graph_init(struct route_graph *this, struct route_info *dst, s if (val != INT_MAX) { val = val*dst->percent/100; s->start->seg = s; + s->start->dst_seg = s; s->start->rhs = val; s->start->dst_val = val; s->start->el = fh_insertkey(this->heap, MIN(s->start->rhs, s->start->value), s->start); @@ -1457,6 +1459,7 @@ static void route_graph_reset(struct route_graph *this) { curr->dst_val = INT_MAX; curr->rhs = INT_MAX; curr->seg=NULL; + curr->dst_seg = NULL; curr->el=NULL; curr=curr->hash_next; } @@ -2111,7 +2114,7 @@ static void route_graph_point_update(struct vehicleprofile *profile, struct rout int new, val; p->rhs = p->dst_val; - p->seg = NULL; + p->seg = p->dst_seg; for (s = p->start; s; s = s->start_next) { /* Iterate over all the segments leading away from our point */ val = route_value_seg(profile, s->end, s, 1); diff --git a/navit/route_protected.h b/navit/route_protected.h index 1de3c7206..9b7bf62f6 100644 --- a/navit/route_protected.h +++ b/navit/route_protected.h @@ -64,6 +64,8 @@ struct route_graph_point { * equal to `value` after the route graph has been flooded. */ int dst_val; /**< For points close to the destination, this is the cost of the point if it * is the last in the graph; `INT_MAX` for all other points. */ + struct route_graph_segment *dst_seg; /**< For points close to the destination, this is the segment over which the + * destination can be reached directly */ struct coord c; /**< Coordinates of this point */ int flags; /**< Flags for this point (e.g. traffic distortion) */ }; |