Added angle based turn costs
This commit is contained in:
		
							parent
							
								
									b98a67223b
								
							
						
					
					
						commit
						7585dec359
					
				| @ -145,13 +145,10 @@ void EdgeBasedGraphFactory::Run() { | |||||||
|                         newEdge.source = edgeBasedSource; |                         newEdge.source = edgeBasedSource; | ||||||
|                         newEdge.target = edgeBasedTarget; |                         newEdge.target = edgeBasedTarget; | ||||||
| 
 | 
 | ||||||
|                         //Todo: incorporate turn costs
 |                         //incorporate turn costs, this is just a simple model and can (read: must) be extended
 | ||||||
|                         /* double angle = GetAngleBetweenTwoEdges(inputNodeInfoList[u], inputNodeInfoList[v], inputNodeInfoList[w]);
 |                         double angle = GetAngleBetweenTwoEdges(inputNodeInfoList[u], inputNodeInfoList[v], inputNodeInfoList[w]); | ||||||
|                         double delta = std::min(_nodeBasedGraph->GetEdgeData(e1).distance, _nodeBasedGraph->GetEdgeData(e2).distance); | 
 | ||||||
|                         double radius = std::tan(angle/2.) * delta/2.; |                         newEdge.data.distance = (int)( _nodeBasedGraph->GetEdgeData(e1).distance *(1+std::abs((angle-180.)/180.))); | ||||||
|                         double max_v = std::sqrt(0.31*radius); |  | ||||||
|                         */ |  | ||||||
|                         newEdge.data.distance = _nodeBasedGraph->GetEdgeData(e1).distance /*+ (int)max_v*/; |  | ||||||
|                         newEdge.data.forward = true; |                         newEdge.data.forward = true; | ||||||
|                         newEdge.data.backward = false; |                         newEdge.data.backward = false; | ||||||
|                         newEdge.data.via = v; |                         newEdge.data.via = v; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user