Renaming vector
This commit is contained in:
parent
ade2ecdb8e
commit
8d83ce47e9
@ -38,15 +38,15 @@ EdgeBasedGraphFactory::EdgeBasedGraphFactory(int nodes, std::vector<NodeBasedEdg
|
|||||||
std::sort(inputRestrictions.begin(), inputRestrictions.end(), CmpRestrictionByFrom);
|
std::sort(inputRestrictions.begin(), inputRestrictions.end(), CmpRestrictionByFrom);
|
||||||
|
|
||||||
BOOST_FOREACH(NodeID id, bn) {
|
BOOST_FOREACH(NodeID id, bn) {
|
||||||
_bollardNodes.Add(id, true);
|
_barrierNodes[id] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_FOREACH(NodeID id, tl) {
|
BOOST_FOREACH(NodeID id, tl) {
|
||||||
_trafficLights.Add(id, true);
|
_trafficLights[id] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
INFO("bollards: " << _bollardNodes.Size());
|
INFO("bollards: " << _barrierNodes.size());
|
||||||
INFO("signals: " << _trafficLights.Size());
|
INFO("signals: " << _trafficLights.size());
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ void EdgeBasedGraphFactory::Run() {
|
|||||||
edgeBasedNodes.push_back(currentNode);
|
edgeBasedNodes.push_back(currentNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_bollardNodes.Find(v) == true) {
|
if(_barrierNodes.find(v) != _barrierNodes.end() ) {
|
||||||
numberOfSkippedTurns += _nodeBasedGraph->EndEdges(v) - _nodeBasedGraph->BeginEdges(v);
|
numberOfSkippedTurns += _nodeBasedGraph->EndEdges(v) - _nodeBasedGraph->BeginEdges(v);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -229,10 +229,10 @@ void EdgeBasedGraphFactory::Run() {
|
|||||||
EdgeBasedEdge newEdge(edgeBasedSource, edgeBasedTarget, v, nameID, distance, true, false, turnInstruction);
|
EdgeBasedEdge newEdge(edgeBasedSource, edgeBasedTarget, v, nameID, distance, true, false, turnInstruction);
|
||||||
edgeBasedEdges.push_back(newEdge);
|
edgeBasedEdges.push_back(newEdge);
|
||||||
|
|
||||||
if(_bollardNodes.Find(w) == true){
|
//Ways Ending at bollard get dead-end street treatment;
|
||||||
// INFO("[" << w << "] loc: " << inputNodeInfoList[w].lat << "," << inputNodeInfoList[w].lon << ", tgt: " << edgeBasedTarget);
|
if(_barrierNodes.find(w) != _barrierNodes.end()){
|
||||||
//if node v is a bollard, then we need to add e2 as target node to the new set of edgebased nodes.
|
//if node v is a bollard, then we need to add e2 as target node to the new set of edgebased nodes.
|
||||||
//Otherwise it will not be possible to route to route to this node
|
//Otherwise it will not be possible to properly route to this node
|
||||||
EdgeBasedNode currentNode;
|
EdgeBasedNode currentNode;
|
||||||
currentNode.nameID = _nodeBasedGraph->GetEdgeData(e1).nameID;
|
currentNode.nameID = _nodeBasedGraph->GetEdgeData(e1).nameID;
|
||||||
currentNode.lat1 = inputNodeInfoList[v].lat;
|
currentNode.lat1 = inputNodeInfoList[v].lat;
|
||||||
@ -242,8 +242,8 @@ void EdgeBasedGraphFactory::Run() {
|
|||||||
currentNode.id = edgeBasedTarget;
|
currentNode.id = edgeBasedTarget;
|
||||||
currentNode.ignoreInGrid = _nodeBasedGraph->GetEdgeData(e2).ignoreInGrid;
|
currentNode.ignoreInGrid = _nodeBasedGraph->GetEdgeData(e2).ignoreInGrid;
|
||||||
edgeBasedNodes.push_back(currentNode);
|
edgeBasedNodes.push_back(currentNode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_nodeBasedGraph->GetEdgeData(e1).type != SHRT_MAX ) {
|
if(_nodeBasedGraph->GetEdgeData(e1).type != SHRT_MAX ) {
|
||||||
EdgeBasedNode currentNode;
|
EdgeBasedNode currentNode;
|
||||||
currentNode.nameID = _nodeBasedGraph->GetEdgeData(e1).nameID;
|
currentNode.nameID = _nodeBasedGraph->GetEdgeData(e1).nameID;
|
||||||
|
@ -83,8 +83,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
boost::shared_ptr<_NodeBasedDynamicGraph> _nodeBasedGraph;
|
boost::shared_ptr<_NodeBasedDynamicGraph> _nodeBasedGraph;
|
||||||
HashTable<NodeID, bool> _bollardNodes;
|
boost::unordered_map<NodeID, bool> _barrierNodes;
|
||||||
HashTable<NodeID, bool> _trafficLights;
|
boost::unordered_map<NodeID, bool> _trafficLights;
|
||||||
|
|
||||||
std::vector<_Restriction> & inputRestrictions;
|
std::vector<_Restriction> & inputRestrictions;
|
||||||
std::vector<NodeInfo> & inputNodeInfoList;
|
std::vector<NodeInfo> & inputNodeInfoList;
|
||||||
|
Loading…
Reference in New Issue
Block a user