don't assign lanes on delayed turns

This commit is contained in:
Moritz Kobitzsch
2016-07-08 11:45:36 +02:00
parent af47252efe
commit b6dbf81206
12 changed files with 265 additions and 157 deletions
+11 -15
View File
@@ -8,6 +8,7 @@
#include "util/simple_logger.hpp"
#include "util/typedefs.hpp"
#include <cstddef>
#include <cstdint>
#include <boost/algorithm/string/predicate.hpp>
@@ -106,8 +107,6 @@ TurnLaneHandler::assignTurnLanes(const NodeID at, const EdgeID via_edge, Interse
previous_lane_data,
previous_description_id);
std::cout << "[turn lane] " << scenario_names[scenario] << std::endl;
if (scenario != TurnLaneHandler::NONE)
(*count_called)++;
@@ -132,9 +131,7 @@ TurnLaneHandler::assignTurnLanes(const NodeID at, const EdgeID via_edge, Interse
return handleSliproadTurn(std::move(intersection),
lane_description_id,
std::move(lane_data),
previous_intersection,
previous_description_id,
previous_lane_data);
previous_intersection);
case TurnLaneScenario::MERGE:
return intersection;
default:
@@ -295,7 +292,7 @@ TurnLaneHandler::deduceScenario(const NodeID at,
// FIXME the lane to add depends on the side of driving/u-turn rules in the country
if (!lane_data.empty() && canMatchTrivially(intersection, lane_data) &&
is_missing_valid_u_turn && !hasTag(TurnLaneType::none, lane_data))
lane_data.push_back({TurnLaneType::uturn, lane_data.back().to, lane_data.back().to});
lane_data.push_back({TurnLaneType::uturn, lane_data.back().to, lane_data.back().to, false});
bool is_simple = isSimpleIntersection(lane_data, intersection);
@@ -663,6 +660,8 @@ std::pair<LaneDataVector, LaneDataVector> TurnLaneHandler::partitionLaneData(
if (lane == straightmost_tag_index)
{
augmentEntry(turn_lane_data[straightmost_tag_index]);
// disable this turn for assignment if it is a -use lane only
turn_lane_data[straightmost_tag_index].suppress_assignment = true;
}
if (matched_at_first[lane])
@@ -674,7 +673,7 @@ std::pair<LaneDataVector, LaneDataVector> TurnLaneHandler::partitionLaneData(
std::count(matched_at_second.begin(), matched_at_second.end(), true)) ==
getNumberOfTurns(next_intersection))
{
TurnLaneData data = {TurnLaneType::straight, 255, 0};
TurnLaneData data = {TurnLaneType::straight, 255, 0, true};
augmentEntry(data);
first.push_back(data);
std::sort(first.begin(), first.end());
@@ -701,15 +700,12 @@ Intersection TurnLaneHandler::simpleMatchTuplesToTurns(Intersection intersection
std::move(intersection), lane_data, node_based_graph, lane_description_id, id_map);
}
Intersection
TurnLaneHandler::handleSliproadTurn(Intersection intersection,
const LaneDescriptionID lane_description_id,
LaneDataVector lane_data,
const Intersection &previous_intersection,
const LaneDescriptionID &previous_lane_description_id,
const LaneDataVector &previous_lane_data)
Intersection TurnLaneHandler::handleSliproadTurn(Intersection intersection,
const LaneDescriptionID lane_description_id,
LaneDataVector lane_data,
const Intersection &previous_intersection)
{
const auto sliproad_index =
const std::size_t sliproad_index =
std::distance(previous_intersection.begin(),
std::find_if(previous_intersection.begin(),
previous_intersection.end(),