<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Mani,<br>
<br>
yes, you would need to add a long parameter to the calcWeight
method as well as extend one (or all) algorithms to calculate and
pass this parameter to the method. Then grab the timestamp and
select the appropriate weight for an edge in the calcWeight method<br>
<br>
> So the only thing left is to calculate time in the algorithm
itself.<br>
<br>
Yes, you have no other option I think.<br>
<br>
<br>
> Also why did you mention 'not easy'? Did I miss something
important?<br>
<br>
If you want to have the fastest solution and make sure you always
return the correct one you need to read more about how public
transport routing works e.g. you can't use CH for the
time-dependent model that you have in mind (and read about this
model vs. time-expanded graph). So for your use case the time-dep
model could be lead to sufficient performance, but it could also
be very slow. Also it gets more complex for multi modal stuff etc.<br>
<br>
Kind Regards,<br>
Peter<br>
<br>
On 29.07.2015 10:44, Manikanta Kondeti wrote:<br>
</div>
<blockquote
cite="mid:CAMxCCEbNhDKbLf=Z92_u9sHP46R_rj5NY_4xAV_cytAy71-1cA@mail.gmail.com"
type="cite">
<div dir="ltr"><br>
<div class="gmail_extra">Hi Peter,</div>
<div class="gmail_extra"> <br>
<div class="gmail_quote">On Wed, Jul 29, 2015 at 1:40 PM,
Peter <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:graphhopper@gmx.de" target="_blank">graphhopper@gmx.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hi Mani,<br>
<br>
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. <br>
<br>
</div>
</div>
</blockquote>
<div> </div>
<div> I have an object which takes care of restricted edges
with time intervals. What I am thinking is to tweak the
calcWeight method in my custom weighting and pass a new
parameter which a unix timestamp(long variable). So the
only thing left is to calculate time in the algorithm
itself. While talking about tweaking algorithm, this is
what i wanted to do. I will have a currTime as a member
variable and add currTime only when a new node is added
to the path and pass it to the calcWeight method whenever
it checks for a restriction. That is only two places we
need to tweak. </div>
<div> </div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div> 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.<br>
<br>
</div>
</div>
</blockquote>
<div><br>
</div>
<div> Usecase is not generic but instead of simple set of
blocking edges we have set of edges that are time
dependent. So the idea is to calculate the time while
calculating the path. Will the above specified method
works? Also why did you mention 'not easy'? Did I miss
something important? </div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div> Kind Regards,<br>
Peter
<div>
<div class="h5"><br>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Thanks,</div>
<div>Mani </div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>
<div>
<div class="h5"> <br>
On 29.07.2015 09:40, Manikanta Kondeti wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div class="h5">
<div dir="ltr">Hi Peter,
<div><br>
</div>
<div> 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. </div>
<div><br>
</div>
<div>Thanks, </div>
<div>Mani <br>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>