Fixing several of the flickering issues.
This commit is contained in:
		
							parent
							
								
									b08104367e
								
							
						
					
					
						commit
						3a984668d6
					
				| @ -89,19 +89,19 @@ public: | |||||||
|             _backwardHeap->Insert(phantomNodes.targetPhantom.edgeBasedNode+1, phantomNodes.targetPhantom.weight2, phantomNodes.targetPhantom.edgeBasedNode+1); |             _backwardHeap->Insert(phantomNodes.targetPhantom.edgeBasedNode+1, phantomNodes.targetPhantom.weight2, phantomNodes.targetPhantom.edgeBasedNode+1); | ||||||
| //            INFO("d) back insert " << phantomNodes.targetPhantom.edgeBasedNode+1 << ", weight: " << phantomNodes.targetPhantom.weight2);
 | //            INFO("d) back insert " << phantomNodes.targetPhantom.edgeBasedNode+1 << ", weight: " << phantomNodes.targetPhantom.weight2);
 | ||||||
|         } |         } | ||||||
|         int startOffset = (phantomNodes.startPhantom.isBidirected() ? std::max(phantomNodes.startPhantom.weight1, phantomNodes.startPhantom.weight2) : phantomNodes.startPhantom.weight1) ; |         int offset = (phantomNodes.startPhantom.isBidirected() ? std::max(phantomNodes.startPhantom.weight1, phantomNodes.startPhantom.weight2) : phantomNodes.startPhantom.weight1) ; | ||||||
|         int targetOffset = (phantomNodes.targetPhantom.isBidirected() ? std::max(phantomNodes.targetPhantom.weight1, phantomNodes.targetPhantom.weight2) : phantomNodes.targetPhantom.weight1) ; |         offset += (phantomNodes.targetPhantom.isBidirected() ? std::max(phantomNodes.targetPhantom.weight1, phantomNodes.targetPhantom.weight2) : phantomNodes.targetPhantom.weight1) ; | ||||||
| 
 | 
 | ||||||
|         while(_forwardHeap->Size() + _backwardHeap->Size() > 0){ |         while(_forwardHeap->Size() + _backwardHeap->Size() > 0){ | ||||||
|             if(_forwardHeap->Size() > 0){ |             if(_forwardHeap->Size() > 0){ | ||||||
|                 _RoutingStep(_forwardHeap, _backwardHeap, true, &middle, &_upperbound, startOffset+targetOffset); |                 _RoutingStep(_forwardHeap, _backwardHeap, true, &middle, &_upperbound, 2*offset); | ||||||
|             } |             } | ||||||
|             if(_backwardHeap->Size() > 0){ |             if(_backwardHeap->Size() > 0){ | ||||||
|                 _RoutingStep(_backwardHeap, _forwardHeap, false, &middle, &_upperbound, startOffset+targetOffset); |                 _RoutingStep(_backwardHeap, _forwardHeap, false, &middle, &_upperbound, 2*offset); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         INFO("-> dist " << _upperbound); | //        INFO("-> dist " << _upperbound);
 | ||||||
|         if ( _upperbound == INT_MAX ) { |         if ( _upperbound == INT_MAX ) { | ||||||
|             return _upperbound; |             return _upperbound; | ||||||
|         } |         } | ||||||
| @ -158,7 +158,7 @@ public: | |||||||
|         return GetEscapedNameForNameID(nameID); |         return GetEscapedNameForNameID(nameID); | ||||||
|     } |     } | ||||||
| private: | private: | ||||||
|     inline void _RoutingStep(HeapPtr & _forwardHeap, HeapPtr & _backwardHeap, const bool & forwardDirection, NodeID *middle, int *_upperbound, const int negativeOffset) const { |     inline void _RoutingStep(HeapPtr & _forwardHeap, HeapPtr & _backwardHeap, const bool & forwardDirection, NodeID *middle, int *_upperbound, const int edgeBasedOffset) const { | ||||||
|         const NodeID node = _forwardHeap->DeleteMin(); |         const NodeID node = _forwardHeap->DeleteMin(); | ||||||
|         const int distance = _forwardHeap->GetKey(node); |         const int distance = _forwardHeap->GetKey(node); | ||||||
| //        INFO((forwardDirection ? "[forw]" : "[back]") << " settled node " << node << " at distance " << distance);
 | //        INFO((forwardDirection ? "[forw]" : "[back]") << " settled node " << node << " at distance " << distance);
 | ||||||
| @ -176,7 +176,7 @@ private: | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if(distance-negativeOffset > *_upperbound){ |         if(distance-edgeBasedOffset > *_upperbound){ | ||||||
|             _forwardHeap->DeleteAll(); |             _forwardHeap->DeleteAll(); | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -217,7 +217,7 @@ private: | |||||||
|                 } |                 } | ||||||
|                 //Found a shorter Path -> Update distance
 |                 //Found a shorter Path -> Update distance
 | ||||||
|                 else if ( toDistance < _forwardHeap->GetKey( to ) ) { |                 else if ( toDistance < _forwardHeap->GetKey( to ) ) { | ||||||
| //                    INFO((forwardDirection ? "[forw]" : "[back]") << " decrease and scanning edge (" << node << "," << to << ") with distance " << toDistance << ", edge length: " << data.distance);
 | //                    INFO((forwardDirection ? "[forw]" : "[back]") << " decrease and scanning edge (" << node << "," << to << ") from " << _forwardHeap->GetKey(to) << "to " << toDistance << ", edge length: " << data.distance);
 | ||||||
|                     _forwardHeap->GetData( to ).parent = node; |                     _forwardHeap->GetData( to ).parent = node; | ||||||
|                     _forwardHeap->DecreaseKey( to, toDistance ); |                     _forwardHeap->DecreaseKey( to, toDistance ); | ||||||
|                     //new parent
 |                     //new parent
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user