From 0649f6e607e6573c52b087af15548b728889a932 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Mon, 27 Jan 2014 11:18:26 +0100 Subject: [PATCH] preparing call of turn penalty function --- Contractor/EdgeBasedGraphFactory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Contractor/EdgeBasedGraphFactory.cpp b/Contractor/EdgeBasedGraphFactory.cpp index 6eaa9b443..aa7cfadf5 100644 --- a/Contractor/EdgeBasedGraphFactory.cpp +++ b/Contractor/EdgeBasedGraphFactory.cpp @@ -399,12 +399,12 @@ void EdgeBasedGraphFactory::Run( if( m_traffic_lights.find(v) != m_traffic_lights.end() ) { distance += speed_profile.trafficSignalPenalty; } - const unsigned penalty = GetTurnPenalty(u, v, w, lua_state); + const int turn_penalty = 10*GetTurnPenalty(u, v, w, lua_state); TurnInstruction turnInstruction = AnalyzeTurn(u, v, w); if(turnInstruction == TurnInstructions.UTurn){ distance += speed_profile.uTurnPenalty; } - distance += penalty; + distance += turn_penalty; original_edge_data_vector.push_back( OriginalEdgeData( @@ -473,7 +473,7 @@ int EdgeBasedGraphFactory::GetTurnPenalty( return luabind::call_function( lua_state, "turn_function", - 180.-angle + std::abs(180.-angle) ); } catch (const luabind::error &er) { SimpleLogger().Write(logWARNING) << er.what();