return INT_MAX;
if (from && from->seg == over)
return INT_MAX;
+ if (over->data.flags & AF_THROUGH_TRAFFIC_LIMIT)
+ return profile->through_traffic_penalty;
if ((over->start->flags & RP_TRAFFIC_DISTORTION) && (over->end->flags & RP_TRAFFIC_DISTORTION)) {
struct route_traffic_distortion dist;
if (route_get_traffic_distortion(over, &dist))
s=p_min->start;
while (s) { /* Iterating all the segments leading away from our point to update the points at their ends */
val=route_value_seg(profile, p_min, s, -1);
- if (val != INT_MAX) {
+ if (val != INT_MAX && !item_is_equal(s->data.item,p_min->seg->data.item)) {
new=min+val;
if (debug_route)
printf("begin %d len %d vs %d (0x%x,0x%x)\n",new,val,s->end->value, s->end->c.x, s->end->c.y);
s=p_min->end;
while (s) { /* Doing the same as above with the segments leading towards our point */
val=route_value_seg(profile, p_min, s, 1);
- if (val != INT_MAX) {
+ if (val != INT_MAX && !item_is_equal(s->data.item,p_min->seg->data.item)) {
new=min+val;
if (debug_route)
printf("end %d len %d vs %d (0x%x,0x%x)\n",new,val,s->start->value,s->start->c.x, s->start->c.y);
{
struct route_graph_point *prev,*next;
struct route_graph_segment *tmp1,*tmp2;
+ if (item_is_equal(from->data.item, to->data.item))
+ return 0;
if (from->start == p)
prev=from->end;
else
case attr_static_distance:
this_->static_distance=attr->u.num;
break;
+ case attr_through_traffic_penalty:
+ this_->through_traffic_penalty=attr->u.num;
+ break;
default:
break;
}
this_->height=-1;
this_->weight=-1;
this_->axle_weight=-1;
+ this_->through_traffic_penalty=9000;
for (attr=attrs;*attr; attr++)
vehicleprofile_set_attr_do(this_, *attr);
return this_;
int weight; /**< Weight of the vehicle in kg */
int axle_weight; /**< Axle Weight of the vehicle in kg */
int dangerous_goods; /**< Flags of dangerous goods present */
+ int through_traffic_penalty; /**< Penalty when driving on a through traffic limited road */
struct attr **attrs;
GHashTable *roadprofile_hash;
};