minor renaming efforts

This commit is contained in:
Dennis Luxen 2014-03-26 15:28:50 +01:00
parent 44077cb007
commit 549bcb502b

View File

@ -105,13 +105,16 @@ public:
/** starts at index 1 */ /** starts at index 1 */
pathDescription[0].length = 0; pathDescription[0].length = 0;
for(unsigned i = 1; i < pathDescription.size(); ++i) { for(unsigned i = 1; i < pathDescription.size(); ++i)
{
pathDescription[i].length = FixedPointCoordinate::ApproximateEuclideanDistance(pathDescription[i-1].location, pathDescription[i].location); pathDescription[i].length = FixedPointCoordinate::ApproximateEuclideanDistance(pathDescription[i-1].location, pathDescription[i].location);
} }
// std::string string0 = facade->GetEscapedNameForNameID(pathDescription[0].name_id); for (unsigned i = 0; i < pathDescription.size(); ++i)
// std::string string1; {
const std::string name = facade->GetEscapedNameForNameID(pathDescription[0].name_id);
SimpleLogger().Write(logDEBUG) << "[" << i << "] name: " << name << ", duration: " << pathDescription[i].duration << ", length: " << pathDescription[i].length << ", coordinate: " << pathDescription[i].location;
}
/*Simplify turn instructions /*Simplify turn instructions
Input : Input :
@ -154,23 +157,23 @@ public:
// string0 = string1; // string0 = string1;
// } // }
double lengthOfSegment = 0; double segment_length = 0.;
unsigned durationOfSegment = 0; unsigned segment_duration = 0;
unsigned indexOfSegmentBegin = 0; unsigned segment_start_index = 0;
for(unsigned i = 1; i < pathDescription.size(); ++i) { for(unsigned i = 1; i < pathDescription.size(); ++i) {
entireLength += pathDescription[i].length; entireLength += pathDescription[i].length;
lengthOfSegment += pathDescription[i].length; segment_length += pathDescription[i].length;
durationOfSegment += pathDescription[i].duration; segment_duration += pathDescription[i].duration;
pathDescription[indexOfSegmentBegin].length = lengthOfSegment; pathDescription[segment_start_index].length = segment_length;
pathDescription[indexOfSegmentBegin].duration = durationOfSegment; pathDescription[segment_start_index].duration = segment_duration;
if(TurnInstructionsClass::NoTurn != pathDescription[i].turn_instruction) { if(TurnInstructionsClass::NoTurn != pathDescription[i].turn_instruction) {
BOOST_ASSERT(pathDescription[i].necessary); BOOST_ASSERT(pathDescription[i].necessary);
lengthOfSegment = 0; segment_length = 0;
durationOfSegment = 0; segment_duration = 0;
indexOfSegmentBegin = i; segment_start_index = i;
} }
} }
@ -183,7 +186,7 @@ public:
target_phantom.name_id = (pathDescription.end()-2)->name_id; target_phantom.name_id = (pathDescription.end()-2)->name_id;
} }
} else { } else {
pathDescription[indexOfSegmentBegin].duration *= (1.-target_phantom.ratio); pathDescription[segment_start_index].duration *= (1.-target_phantom.ratio);
} }
if(std::numeric_limits<double>::epsilon() > pathDescription[0].length) { if(std::numeric_limits<double>::epsilon() > pathDescription[0].length) {
if(pathDescription.size() > 2) { if(pathDescription.size() > 2) {