preparing call of turn penalty function
This commit is contained in:
parent
22c2efded9
commit
0649f6e607
@ -399,12 +399,12 @@ void EdgeBasedGraphFactory::Run(
|
|||||||
if( m_traffic_lights.find(v) != m_traffic_lights.end() ) {
|
if( m_traffic_lights.find(v) != m_traffic_lights.end() ) {
|
||||||
distance += speed_profile.trafficSignalPenalty;
|
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);
|
TurnInstruction turnInstruction = AnalyzeTurn(u, v, w);
|
||||||
if(turnInstruction == TurnInstructions.UTurn){
|
if(turnInstruction == TurnInstructions.UTurn){
|
||||||
distance += speed_profile.uTurnPenalty;
|
distance += speed_profile.uTurnPenalty;
|
||||||
}
|
}
|
||||||
distance += penalty;
|
distance += turn_penalty;
|
||||||
|
|
||||||
original_edge_data_vector.push_back(
|
original_edge_data_vector.push_back(
|
||||||
OriginalEdgeData(
|
OriginalEdgeData(
|
||||||
@ -473,7 +473,7 @@ int EdgeBasedGraphFactory::GetTurnPenalty(
|
|||||||
return luabind::call_function<int>(
|
return luabind::call_function<int>(
|
||||||
lua_state,
|
lua_state,
|
||||||
"turn_function",
|
"turn_function",
|
||||||
180.-angle
|
std::abs(180.-angle)
|
||||||
);
|
);
|
||||||
} catch (const luabind::error &er) {
|
} catch (const luabind::error &er) {
|
||||||
SimpleLogger().Write(logWARNING) << er.what();
|
SimpleLogger().Write(logWARNING) << er.what();
|
||||||
|
Loading…
Reference in New Issue
Block a user