nompute a vector<bool> that indicates if it's possible at all to take a turn at a certain node

This commit is contained in:
Dennis Luxen
2010-09-29 16:40:36 +00:00
parent 676f64b0ef
commit 94cfb4aad7
3 changed files with 35 additions and 6 deletions
-3
View File
@@ -107,10 +107,7 @@ public:
}
void Run() {
double time = _Timestamp();
RemoveUselessShortcuts();
time = _Timestamp() - time;
cout << "Postprocessing Time: " << time << " s" << endl;
}
template< class EdgeT >
+24 -2
View File
@@ -274,7 +274,7 @@ public:
}
template< class InputEdge >
void checkForAllOrigEdges(std::vector< InputEdge >& inputEdges)
void CheckForAllOrigEdges(std::vector< InputEdge >& inputEdges)
{
for(unsigned int i = 0; i < inputEdges.size(); i++)
{
@@ -295,6 +295,29 @@ public:
}
}
template< class InputEdge >
void ComputeTurnInfoVector(std::vector< InputEdge >& inputEdges, std::vector<bool> * forwardTurnInfo, std::vector<bool> * backwardTurnInfo)
{
forwardTurnInfo->resize(inputEdges.size(), false);
backwardTurnInfo->resize(inputEdges.size(), false);
for(unsigned n = 0; n < inputEdges.size(); n++) {
if(inputEdges[n].data.forward)
{
NodeID target = inputEdges[n].target;
if(_graph->BeginEdges(target)+1 < _graph->EndEdges(target)) {
forwardTurnInfo->at(n) = true;
}
}
if(inputEdges[n].data.backward)
{
NodeID source = inputEdges[n].source;
if(_graph->BeginEdges(source)+1 < _graph->EndEdges(source)) {
backwardTurnInfo->at(n) = true;
}
}
}
}
void Run() {
const NodeID numberOfNodes = _graph->GetNumberOfNodes();
_LogData log;
@@ -480,7 +503,6 @@ public:
}
private:
double _Timestamp() {
return time(NULL);
}