<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Guillaume,</div><div class=""><br class=""></div><div class="">  Yes, that's basically correct, you've understood the rough structure.  We typically call the first graph, that looks like OSM, the "node-based-graph".  The graph that models all turns is referred to as the "edge-based-graph".  Somewhat confusing terminology, I know.</div><div class=""><br class=""></div><div class="">  The edge-based-graph edge weights are measured in deci-seconds.  Everything is routed based on travel time.</div><div class=""><br class=""></div><div class="">  The "speed * length" calculation happens slightly earlier in the process:</div><div class=""><br class=""></div><div class="">    <a href="https://github.com/Project-OSRM/osrm-backend/blob/develop/extractor/extraction_containers.cpp#L323-L337" class="">https://github.com/Project-OSRM/osrm-backend/blob/develop/extractor/extraction_containers.cpp#L323-L337</a></div><div class=""><br class=""></div><div class="">  Unfortunately, the terminology used "distance/weight" is not consistent across the codebase, so it can be difficult to navigate.  Suffice to say, the traffic penalty is adding "deci-seconds" to the edge-based-edge-weight.</div><div class=""><br class=""></div><div class="">  To do per-node penalties, you would need to add a lookup table for each node, populate it, probably in the "node_function" in the Lua profile, then consult the lookup in the same place the traffic light penalty is currently added.</div><div class=""><br class=""></div><div class="">daniel</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 21, 2015, at 2:26 PM, Guillaume Barreau <<a href="mailto:g.barreau@gmail.com" class="">g.barreau@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class="">Thanks Daniel and Patrick for your help,<br class=""><br class=""></div><div class="">I will have to pick your brains a little bit more I am afraid.<br class=""></div><div class=""><br class=""></div>Having read this page: <a href="https://github.com/Project-OSRM/osrm-backend/wiki/Graph-representation" class="">https://github.com/Project-OSRM/osrm-backend/wiki/Graph-representation</a> <br class=""><br class="">I now understand that what OSRM models as a node is actually what I initially thought of as an edge (i.e. a piece of road connecting 2 intersections) and what OSRM calls an edge is a transition from one road segment (travelled in a particular direction) to another, so the edge ends up being a way of crossing a road intersection. This is kind of confusing at first, but I can see the benefits of doing that way in terms of handling intersections well. Please correct me if I haven't understood properly.<br class=""><br class=""></div><div class="">So in my case, the penalty would be associated with edges and not nodes. And all edges associated with the same physical interesection would get the same penalty (although this way of modelling has the advantage of allowing each turn to have a different penalty easily).<br class=""><br class=""></div><div class="">The code you pointed me to is called at the graph preparation phase, right? That is fine for my purposes, I am just clarifying.<br class=""><br class=""></div>This distance variable that is incremented it ends up representing the total penalties associated with crossing that particular intersection in a particular way and I assume it gets stored as the attribute of the corresponding edge in the graph. I was curious of when and how this distance (a penalty expressed in meters) then gets converted back into a time. <br class=""><div class=""><div class=""><br class=""></div><div class="">Thanks a lot for your time again,<br class=""><br class=""></div><div class="">Guillaume<br class=""></div><br class=""><div class=""><br class=""></div></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On 21 October 2015 at 15:56, Daniel Patterson <span dir="ltr" class=""><<a href="mailto:daniel@mapbox.com" target="_blank" class="">daniel@mapbox.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks Patrick, yes, that was what I meant to point at :-)<br class="">
<div class="HOEnZb"><div class="h5"><br class="">
> On Oct 21, 2015, at 12:44 PM, Patrick Niklaus <<a href="mailto:patrick.niklaus@student.kit.edu" class="">patrick.niklaus@student.kit.edu</a>> wrote:<br class="">
><br class="">
> Hey Guillaume,<br class="">
><br class="">
> I think Daniel wanted to post a link to this line:<br class="">
><br class="">
> <a href="https://github.com/Project-OSRM/osrm-backend/blob/develop/extractor/edge_based_graph_factory.cpp#L417" rel="noreferrer" target="_blank" class="">https://github.com/Project-OSRM/osrm-backend/blob/develop/extractor/edge_based_graph_factory.cpp#L417</a><br class="">
><br class="">
> All you need to do is to adapt the code to not only add penalties for<br class="">
> traffic signals but also your node.<br class="">
> Actually this code should be made more general as outlined in<br class="">
> <a href="https://github.com/Project-OSRM/osrm-backend/issues/1490" rel="noreferrer" target="_blank" class="">https://github.com/Project-OSRM/osrm-backend/issues/1490</a><br class="">
><br class="">
> Best,<br class="">
> Patrick<br class="">
><br class="">
><br class="">
> On Wed, Oct 21, 2015 at 9:02 PM, Guillaume Barreau <<a href="mailto:g.barreau@gmail.com" class="">g.barreau@gmail.com</a>> wrote:<br class="">
>> Hi Daniel,<br class="">
>><br class="">
>> Thanks a lot for this very fast reply. The url you sent appears to be<br class="">
>> broken. Could you please double-check it for me?<br class="">
>><br class="">
>> Thanks again,<br class="">
>><br class="">
>> Guillaume<br class="">
>><br class="">
>> On 21 October 2015 at 14:56, Daniel Patterson <<a href="mailto:daniel@mapbox.com" class="">daniel@mapbox.com</a>> wrote:<br class="">
>>><br class="">
>>> Hi Guillaume,<br class="">
>>><br class="">
>>>  There is a function called for every node:<br class="">
>>><br class="">
>>><br class="">
>>> <a href="https://github.com/mapbox/inrix-processing/blob/master/regions.json#L198-L201" rel="noreferrer" target="_blank" class="">https://github.com/mapbox/inrix-processing/blob/master/regions.json#L198-L201</a><br class="">
>>><br class="">
>>>  however, it doesn't feed back any specific per-node penalties.  It's<br class="">
>>> used to flag barriers and traffic lights right now.<br class="">
>>><br class="">
>>>  It could be adapted to do per-node penalty values, you would probably<br class="">
>>> need to modify the existing light penalty functionality and add a lookup for<br class="">
>>> your values, rather than using the global light penalty we have currently.<br class="">
>>><br class="">
>>> daniel<br class="">
>>><br class="">
>>> On Oct 21, 2015, at 11:46 AM, Guillaume Barreau <<a href="mailto:g.barreau@gmail.com" class="">g.barreau@gmail.com</a>><br class="">
>>> wrote:<br class="">
>>><br class="">
>>> Hello,<br class="">
>>><br class="">
>>> I would like to OSRM for a research project but I have this unusual<br class="">
>>> requirement. I would want to be able to add time penalties at some sets of<br class="">
>>> vertices (defined by their id) that would be used to compute the fastest<br class="">
>>> routes in a table calculation. My input would therefore be a list of<br class="">
>>> (node_id,delays) to be added to the underlying graph. Is this feasible? I am<br class="">
>>> prepared to modify the code if needs be, I don't expect to be able to do<br class="">
>>> this with a config file. If it is feasible, could someone point me in the<br class="">
>>> right direction?<br class="">
>>><br class="">
>>> Thank you very much for your help,<br class="">
>>><br class="">
>>> Guillaume<br class="">
>>> _______________________________________________<br class="">
>>> OSRM-talk mailing list<br class="">
>>> <a href="mailto:OSRM-talk@openstreetmap.org" class="">OSRM-talk@openstreetmap.org</a><br class="">
>>> <a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank" class="">https://lists.openstreetmap.org/listinfo/osrm-talk</a><br class="">
>>><br class="">
>>><br class="">
>>><br class="">
>>> _______________________________________________<br class="">
>>> OSRM-talk mailing list<br class="">
>>> <a href="mailto:OSRM-talk@openstreetmap.org" class="">OSRM-talk@openstreetmap.org</a><br class="">
>>> <a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank" class="">https://lists.openstreetmap.org/listinfo/osrm-talk</a><br class="">
>>><br class="">
>><br class="">
>><br class="">
>> _______________________________________________<br class="">
>> OSRM-talk mailing list<br class="">
>> <a href="mailto:OSRM-talk@openstreetmap.org" class="">OSRM-talk@openstreetmap.org</a><br class="">
>> <a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank" class="">https://lists.openstreetmap.org/listinfo/osrm-talk</a><br class="">
>><br class="">
><br class="">
> _______________________________________________<br class="">
> OSRM-talk mailing list<br class="">
> <a href="mailto:OSRM-talk@openstreetmap.org" class="">OSRM-talk@openstreetmap.org</a><br class="">
> <a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank" class="">https://lists.openstreetmap.org/listinfo/osrm-talk</a><br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
OSRM-talk mailing list<br class="">
<a href="mailto:OSRM-talk@openstreetmap.org" class="">OSRM-talk@openstreetmap.org</a><br class="">
<a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank" class="">https://lists.openstreetmap.org/listinfo/osrm-talk</a><br class="">
</div></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">OSRM-talk mailing list<br class=""><a href="mailto:OSRM-talk@openstreetmap.org" class="">OSRM-talk@openstreetmap.org</a><br class="">https://lists.openstreetmap.org/listinfo/osrm-talk<br class=""></div></blockquote></div><br class=""></body></html>