[GraphHopper] Current time calculation in Bidirectional A* and passing it to the custom weighting class

Peter graphhopper at gmx.de
Wed Jul 29 08:10:19 UTC 2015


Hi Mani,

I assumed in my first answer you meant just the starting time. But what
you need is to make the full algorithm time dependent and for that
you'll need to modify the algorithm itself not just the input parameters
like I was suggesting. For example you need to introduce a state object
instead of just the traversalId and the state object also contains the
time to make it possible that some edges are available only up to a
certain time etc.

There are several possibilities, but the short story is that this is not
easy and really depends on the use case you have (public transport?
traffic information?) if there are simple alternatives.

Kind Regards,
Peter

On 29.07.2015 09:40, Manikanta Kondeti wrote:
> Hi Peter, 
>
>    Thanks for the reply. I want to calculate the time for every node
> added to the path. Lets say we have 5 nodes A B C D E.  I've started
> from A, so my currTime variable is defined and set in Astar.java. So I
> am checking for A - B, while calling calcWeight function in a
> weighting , I've to send my currTime updated. Like currTime = currTime
> + ( A-B.distance() / encoder.getSpeed() );  So now in weighting
> calcWeight method I can check for restriction. The problem is clear
> for Astar in one way direction. How about bi-directional?  What
> exactly the above parameter does (heading_penalty)? We need to
> calculate time in routing function ( Astar.java, AstarBi.java,
> Dijkstra.java etc.) , right?   Let me know if I am not clear. 
>
> Thanks, 
> Mani 
>
>
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/graphhopper

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20150729/21b2e27a/attachment.html>


More information about the GraphHopper mailing list