Hi,<br><br>I have documented the design details [1] and written an example tutorial [2] to try out the time_dependent_shortest_path algorithm. I guess this is enough to show the functionality, although, the data and examples along with the wrapper functions need to be worked on in next few weeks. <br>
<br>Any feedback / corrections are welcome.<br><br>[1] <a href="https://github.com/pgRouting/pgrouting/wiki/TDSP-Details">https://github.com/pgRouting/pgrouting/wiki/TDSP-Details</a><br>[2] <a href="https://github.com/pgRouting/pgrouting/wiki/TDSP-Tutorial-and-Example">https://github.com/pgRouting/pgrouting/wiki/TDSP-Tutorial-and-Example</a><br>
<br><div class="gmail_quote">On Tue, Jul 5, 2011 at 11:54 AM, Jay Mahadeokar <span dir="ltr">&lt;<a href="mailto:jai.mahadeokar@gmail.com">jai.mahadeokar@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br><br>An update - <br><br>I have coded the functions to retrieve data from time_dep_costs table and it is presented to the core tdsp algorithm along with the data from ways table. The query seems to be working nicely for now.<br>

<br>The query format is:<br><br>CREATE OR REPLACE FUNCTION time_dependent_shortest_path(<br>        sql text, <br>        source_id integer, <br>        target_id integer, <br>        directed boolean, <br>        has_reverse_cost boolean, <br>

        time_dep_sql text,  <br>        query_start_time integer)<br>        RETURNS SETOF path_result<br>        AS &#39;$libdir/librouting_tdsp&#39;<br>        LANGUAGE &#39;C&#39; IMMUTABLE STRICT;<br><br><br>I have updated the github branch accordingly [1].<br>

<br>The script to generate time_dependent_costs data can be found at [2]. I updated travel time of rows with class_id 106 and start_time as 9 or 19 to a large value.  (Signifying that the roads are blocked in those times) I also played around with the travel_time values a bit.<br>

<br>If you do following queries:<br><br>SELECT * FROM time_dependent_shortest_path(&#39;<br>                SELECT gid as id,<br>                         source::integer,<br>                         target::integer,<br>                         length::double precision as cost<br>

                        FROM ways&#39;,<br>                81, 359, true, false,&#39;SELECT edge_id, start_time ,travel_time from time_dep_costs&#39;,14);<br><br>SELECT * FROM time_dependent_shortest_path(&#39;<br>                SELECT gid as id,<br>

                         source::integer,<br>                         target::integer,<br>                         length::double precision as cost<br>                        FROM ways&#39;,<br>                81, 359, true, false,&#39;SELECT edge_id, start_time ,travel_time from time_dep_costs&#39;,9);<br>

<br>The outputs are different. The path returned by second query where query_start_time is 9 avoids the edge (81,82) since its cost is too high, and instead takes a longer route of 39 hops.  On other hand, path returned by 1st query where query_start_time is 14 returns shortest path of 20 hops.<br>

<br>It would be great if anyone can check the code, run queries and give feedback for improvements.<br><br>Now the next task should be to finalise framework to generate proper test data and test the functionality rigorously.<br>

Also, we need to write proper wrapper functions that will neatly map the data from time_dep_costs table into data that can be presented to core function. This means that the factors like cycles in time (23 hrs to 00 hrs) need to be considered. Also it will be better if the costs in table is in time units instead of distance units. I will try and come up with a suitable model soon.<br>

<br>Any inputs in this regard are welcome.<br><br>[1] <a href="https://github.com/pgRouting/pgrouting/tree/gsoc-tdsp" target="_blank">https://github.com/pgRouting/pgrouting/tree/gsoc-tdsp</a><br>[2] <a href="https://github.com/pgRouting/pgrouting/blob/gsoc-tdsp/extra/tdsp/sql/data_generate_tdsp.sql" target="_blank">https://github.com/pgRouting/pgrouting/blob/gsoc-tdsp/extra/tdsp/sql/data_generate_tdsp.sql</a><br>

<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Thu, Jun 23, 2011 at 2:56 AM, Daniel Kastl <span dir="ltr">&lt;<a href="mailto:daniel@georepublic.de" target="_blank">daniel@georepublic.de</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">
<br><br><div class="gmail_quote"><div>2011/6/23 Stephen Woodbridge <span dir="ltr">&lt;<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>&gt;</span><br></div><div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">




Hi Daniel, Jay,<br>
<br>
Ok, sorry for my *rant* about OSM attributes!<br>
<br>
So it looks like osm2po does the importing and classification via its black box java .jar file and you can use the tables afterwards. Ok this could work, but I&#39;m not sure I like the idea of using someone&#39;s black box to import the data. Long term it would be better to just use osm2pgrouting and to understand the issues that I presented and a write a stored procedure to do the classifications that are needed.<br>




</blockquote><div><br></div></div><div>Hi Steve,</div><div><br></div><div>This was just meant to be an easy and quick way for Jay, if he doesn&#39;t want to spend much time with studying OSM attributes.</div><div>But of course I prefer some OS tool, too.</div>




<div>I have tried to convince Carsten (the author of osm2po) to make his really nice conversion tool available as Open Source, but I accept that he doesn&#39;t want to do so (yet ;-).</div><div><br></div><div>So I think it&#39;s good to see how osm2po organizes the tables. </div>



<div><br></div><div>Daniel</div><div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
I have not been on the osm routing list, but I&#39;m sure we can get guidance from them to setup appropriate classifications. Or if someone want to to try out osm2po we can review the resultant tables and look at how they classified segments.<br>





<br>
-Steve<div><br><br></div></blockquote></div></div><br>-- <br><span style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;"><div>Georepublic UG &amp; Georepublic Japan<br>eMail: <a href="mailto:daniel.kastl@georepublic.de" style="color: rgb(66, 99, 171);" target="_blank">daniel.kastl@georepublic.de</a><br>

</div>


Web: <a href="http://georepublic.de/" style="color: rgb(66, 99, 171);" target="_blank">http://georepublic.de</a></span><br>
<br></div></div><div class="im">_______________________________________________<br>
pgrouting-dev mailing list<br>
<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br></div></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br><font color="#888888">-Jay Mahadeokar<br><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>-Jay Mahadeokar<br><br>