Edits to ensure compilation on Windows.
This commit is contained in:
parent
3767ffd79a
commit
ce4112a211
@ -264,8 +264,8 @@ private:
|
|||||||
data->_heapForward->Insert( source, 0, source );
|
data->_heapForward->Insert( source, 0, source );
|
||||||
data->_heapBackward->Insert( target, 0, target );
|
data->_heapBackward->Insert( target, 0, target );
|
||||||
|
|
||||||
int targetDistance = std::numeric_limits< int >::max();
|
int targetDistance = (std::numeric_limits< int >::max)();
|
||||||
NodeID middle = std::numeric_limits<NodeID>::max();
|
NodeID middle = (std::numeric_limits<NodeID>::max)();
|
||||||
|
|
||||||
while ( data->_heapForward->Size() + data->_heapBackward->Size() > 0 ) {
|
while ( data->_heapForward->Size() + data->_heapBackward->Size() > 0 ) {
|
||||||
if ( data->_heapForward->Size() > 0 ) {
|
if ( data->_heapForward->Size() > 0 ) {
|
||||||
|
@ -157,7 +157,7 @@ public:
|
|||||||
forwardEdge.data.shortcut = backwardEdge.data.shortcut = false;
|
forwardEdge.data.shortcut = backwardEdge.data.shortcut = false;
|
||||||
forwardEdge.data.via = backwardEdge.data.via = via;
|
forwardEdge.data.via = backwardEdge.data.via = via;
|
||||||
forwardEdge.data.originalEdges = backwardEdge.data.originalEdges = 1;
|
forwardEdge.data.originalEdges = backwardEdge.data.originalEdges = 1;
|
||||||
forwardEdge.data.distance = backwardEdge.data.distance = std::numeric_limits< int >::max();
|
forwardEdge.data.distance = backwardEdge.data.distance = (std::numeric_limits< int >::max)();
|
||||||
//remove parallel edges
|
//remove parallel edges
|
||||||
while ( i < edges.size() && edges[i].source == source && edges[i].target == target ) {
|
while ( i < edges.size() && edges[i].source == source && edges[i].target == target ) {
|
||||||
if ( edges[i].data.forward )
|
if ( edges[i].data.forward )
|
||||||
@ -397,7 +397,7 @@ private:
|
|||||||
continue;
|
continue;
|
||||||
const NodeID target = _graph->GetTarget( outEdge );
|
const NodeID target = _graph->GetTarget( outEdge );
|
||||||
const int pathDistance = inData.distance + outData.distance;
|
const int pathDistance = inData.distance + outData.distance;
|
||||||
maxDistance = std::max( maxDistance, pathDistance );
|
maxDistance = (std::max)( maxDistance, pathDistance );
|
||||||
if ( !heap.WasInserted( target ) ) {
|
if ( !heap.WasInserted( target ) ) {
|
||||||
heap.Insert( target, pathDistance, _HeapData( true ) );
|
heap.Insert( target, pathDistance, _HeapData( true ) );
|
||||||
numTargets++;
|
numTargets++;
|
||||||
|
@ -141,7 +141,7 @@ public:
|
|||||||
void Clear() {
|
void Clear() {
|
||||||
heap.resize( 1 );
|
heap.resize( 1 );
|
||||||
insertedNodes.clear();
|
insertedNodes.clear();
|
||||||
heap[0].weight = std::numeric_limits< Weight >::min();
|
heap[0].weight = (std::numeric_limits< Weight >::min)();
|
||||||
nodeIndex.Clear();
|
nodeIndex.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ public:
|
|||||||
|
|
||||||
if(0 < settings[highway]) {
|
if(0 < settings[highway]) {
|
||||||
if(0 < maxspeed)
|
if(0 < maxspeed)
|
||||||
w.speed = std::min(maxspeed, settings[highway]);
|
w.speed = (std::min)(maxspeed, settings[highway]);
|
||||||
else
|
else
|
||||||
w.speed = settings[highway];
|
w.speed = settings[highway];
|
||||||
} else {
|
} else {
|
||||||
|
@ -271,7 +271,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
_Coordinate tmp;
|
_Coordinate tmp;
|
||||||
double dist = numeric_limits<double>::max();
|
double dist = (numeric_limits<double>::max)();
|
||||||
BOOST_FOREACH(_GridEdge candidate, candidates) {
|
BOOST_FOREACH(_GridEdge candidate, candidates) {
|
||||||
double r = 0.;
|
double r = 0.;
|
||||||
double tmpDist = ComputeDistance(startCoord, candidate.startCoord, candidate.targetCoord, tmp, &r);
|
double tmpDist = ComputeDistance(startCoord, candidate.startCoord, candidate.targetCoord, tmp, &r);
|
||||||
@ -304,7 +304,7 @@ public:
|
|||||||
|
|
||||||
_GridEdge smallestEdge;
|
_GridEdge smallestEdge;
|
||||||
_Coordinate tmp, newEndpoint;
|
_Coordinate tmp, newEndpoint;
|
||||||
double dist = numeric_limits<double>::max();
|
double dist = (numeric_limits<double>::max)();
|
||||||
BOOST_FOREACH(_GridEdge candidate, candidates) {
|
BOOST_FOREACH(_GridEdge candidate, candidates) {
|
||||||
double r = 0.;
|
double r = 0.;
|
||||||
double tmpDist = ComputeDistance(startCoord, candidate.startCoord, candidate.targetCoord, tmp, &r);
|
double tmpDist = ComputeDistance(startCoord, candidate.startCoord, candidate.targetCoord, tmp, &r);
|
||||||
@ -344,7 +344,7 @@ public:
|
|||||||
// INFO("-> node: " << resultNode.edgeBasedNode << ", bidir: " << (resultNode.isBidirected() ? "yes" : "no"));
|
// INFO("-> node: " << resultNode.edgeBasedNode << ", bidir: " << (resultNode.isBidirected() ? "yes" : "no"));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
double ratio = std::min(1., LengthOfVector(smallestEdge.startCoord, newEndpoint)/LengthOfVector(smallestEdge.startCoord, smallestEdge.targetCoord) );
|
double ratio = (std::min)(1., LengthOfVector(smallestEdge.startCoord, newEndpoint)/LengthOfVector(smallestEdge.startCoord, smallestEdge.targetCoord) );
|
||||||
assert(ratio >= 0 && ratio <=1);
|
assert(ratio >= 0 && ratio <=1);
|
||||||
// INFO("Old weight1: " << resultNode.weight1 << ", old weight2: " << resultNode.weight2);
|
// INFO("Old weight1: " << resultNode.weight1 << ", old weight2: " << resultNode.weight2);
|
||||||
resultNode.weight1 *= ratio;
|
resultNode.weight1 *= ratio;
|
||||||
|
Loading…
Reference in New Issue
Block a user