remove unused instruction types
This commit is contained in:
committed by
Patrick Niklaus
parent
d770c35245
commit
7b32d3184c
@@ -297,35 +297,6 @@ void IntersectionHandler::assignTrivialTurns(const EdgeID via_eid,
|
||||
getTurnDirection(intersection[index].turn.angle)};
|
||||
}
|
||||
|
||||
void IntersectionHandler::assignCountingTurns(const EdgeID via_eid,
|
||||
Intersection &intersection,
|
||||
const std::size_t begin,
|
||||
const std::size_t end,
|
||||
const DirectionModifier modifier) const
|
||||
{
|
||||
const constexpr TurnType turns[] = {TurnType::FirstTurn, TurnType::SecondTurn,
|
||||
TurnType::ThirdTurn, TurnType::FourthTurn};
|
||||
const constexpr TurnType ramps[] = {TurnType::FirstRamp, TurnType::SecondRamp,
|
||||
TurnType::ThirdRamp, TurnType::FourthRamp};
|
||||
|
||||
const std::size_t length = end > begin ? end - begin : begin - end;
|
||||
if (length > 4)
|
||||
{
|
||||
util::SimpleLogger().Write(logDEBUG) << "Counting Turn assignment called for " << length
|
||||
<< " turns. Supports at most four turns.";
|
||||
}
|
||||
|
||||
// counting turns varies whether we consider left/right turns
|
||||
for (std::size_t index = begin, count = 0; index != end;
|
||||
count++, begin < end ? ++index : --index)
|
||||
{
|
||||
if (TurnType::Ramp == findBasicTurnType(via_eid, intersection[index]))
|
||||
intersection[index].turn.instruction = {ramps[count], modifier};
|
||||
else
|
||||
intersection[index].turn.instruction = {turns[count], modifier};
|
||||
}
|
||||
}
|
||||
|
||||
bool IntersectionHandler::isThroughStreet(const std::size_t index,
|
||||
const Intersection &intersection) const
|
||||
{
|
||||
|
||||
@@ -538,7 +538,7 @@ Intersection TurnHandler::assignRightTurns(const EdgeID via_edge,
|
||||
BOOST_ASSERT(intersection[1].entry_allowed && intersection[2].entry_allowed &&
|
||||
intersection[3].entry_allowed);
|
||||
// count backwards from the slightest turn
|
||||
assignCountingTurns(via_edge, intersection, 3, 0, second_direction);
|
||||
assignTrivialTurns(via_edge, intersection, 1, up_to);
|
||||
}
|
||||
else if (((first_direction == second_direction &&
|
||||
angularDeviation(intersection[2].turn.angle, intersection[3].turn.angle) >=
|
||||
@@ -581,12 +581,6 @@ Intersection TurnHandler::assignRightTurns(const EdgeID via_edge,
|
||||
assignTrivialTurns(via_edge, intersection, 1, up_to);
|
||||
}
|
||||
}
|
||||
else if (up_to == 5)
|
||||
{
|
||||
|
||||
// count backwards from the slightest turn
|
||||
assignCountingTurns(via_edge, intersection, 4, 0, DirectionModifier::Right);
|
||||
}
|
||||
else
|
||||
{
|
||||
assignTrivialTurns(via_edge, intersection, 1, up_to);
|
||||
@@ -728,21 +722,6 @@ void TurnHandler::handleDistinctConflict(const EdgeID via_edge,
|
||||
right.turn.instruction = {right_type, DirectionModifier::Left};
|
||||
return;
|
||||
}
|
||||
// Both turns?
|
||||
if (TurnType::Ramp != left_type && TurnType::Ramp != right_type)
|
||||
{
|
||||
if (left.turn.angle < STRAIGHT_ANGLE)
|
||||
{
|
||||
left.turn.instruction = {TurnType::FirstTurn, getTurnDirection(left.turn.angle)};
|
||||
right.turn.instruction = {TurnType::SecondTurn, getTurnDirection(right.turn.angle)};
|
||||
}
|
||||
else
|
||||
{
|
||||
left.turn.instruction = {TurnType::SecondTurn, getTurnDirection(left.turn.angle)};
|
||||
right.turn.instruction = {TurnType::FirstTurn, getTurnDirection(right.turn.angle)};
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Shift the lesser penalty
|
||||
if (getTurnDirection(left.turn.angle) == DirectionModifier::SharpLeft)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user