Skip to content

Conversation

@emiltin
Copy link
Contributor

@emiltin emiltin commented Apr 24, 2014

lower speed of links to more realistic levels. keep in mind that the speeds in the profile are average speeds, not max speeds. a motorway_link now has average of 45, instead of 75, similar pattern for other ways types.

also add tests to verify that links are not used unless the main road has a very low maxspeed (about half the default average).

also increased the max to ave factor from 0.66 to 0.8.

@emiltin
Copy link
Contributor Author

emiltin commented Apr 24, 2014

in the first test, a motorway has maxspeed=60 => ave=48. the link has ave=35. so the motorway is still picked.

in the second test, the motorway has maxspeed=40 => ave=32. since this is lower that the ave of 35 for the link, the link is followed.

@emiltin
Copy link
Contributor Author

emiltin commented Apr 24, 2014

btw, the increase in max to ave factor can be omitted from this PR if desired. just seemed like a good time to consider that too.

@DennisOSRM
Copy link
Collaborator

cool. thanks. will get to this once remove_geometry branch is successfully merged.

@DennisOSRM
Copy link
Collaborator

Thanks for providing this. I gave the approach another thought. Here is what I was thinking:

From a modeling point of view, we should first calculate the free flow speed for each way and only afterwards scale it down to what we think is the average or expected speed. The rationale is that we will apply scaling as the last step as we are getting access to sources of real-time traffic information.

@emiltin
Copy link
Contributor Author

emiltin commented Apr 28, 2014

Do you mean we should specify max speeds in the profile, rather than average speeds?

I think average speeds are generally easier to work with. Wouldn't traffic data usually also consist of average travel speeds?

@emiltin
Copy link
Contributor Author

emiltin commented Apr 28, 2014

A refinement would be to specify both max and average speed for each way type. Implicit this also defines the scaling factor. Example

             max    ave  =factor
motorway     120     90    0.75
residential   30     25    0.83

@DennisOSRM
Copy link
Collaborator

Let me get into more detail here. So, yes, you are right. Let's think of getting maxspeeds right at first. And then we apply scaling or real-time information for that matter. It is important to do the maxspeeds at first, because we view the application of the scaling similar to the application of an operator the underlying data structure.

@DennisOSRM
Copy link
Collaborator

Yeah, cool idea with the type-dependent scaling. This could be a thing to learn from traffic feeds for example. We should make this the very last step of the way_function call.

@emiltin
Copy link
Contributor Author

emiltin commented Apr 28, 2014

I'm not sure I really understand the need to determine maxspeed (free flow) first.

Ultimately, we need the average speed to assign an impedance. Average speed is also what traffic data will usually provide.

If we only have a max speed for a way, but no average, then we need to scale down the max to get to a realistic average.

But if we already have an average, there's no need for scaling or max speed? What is the benefit of modelling it as free flow, lowered by some factor, rather than simply an average?

@DennisOSRM
Copy link
Collaborator

Doing maxspeed first and then having a deliberate step to get that into a realistic number has the benefit of separating between the extraction process and the modeling. Think of a scaling process that needs the maxspeed as an input. Also, I'd like this to be separate for the purpose of maintaining.

@emiltin
Copy link
Contributor Author

emiltin commented Apr 28, 2014

Most of the time no maxspeed tag exists, and we will have no other option than to assign an estimate. So that initial 'clean' max speed value, together with a scaling factor, will just be another way of guestimating the average? That's why I'm wondering if it's not easier to just use averages like we're currently doing.

@DennisOSRM
Copy link
Collaborator

The separation is the key. It makes the entire process of finding reasonable speeds more clearly layed out. First, we try to come up with reasonable maxspeeds. Later, we find estimates for the average. You can work on both parts separately and independently which important for maintainability.

@emiltin
Copy link
Contributor Author

emiltin commented May 6, 2014

rebased on develop

DennisOSRM added a commit that referenced this pull request May 9, 2014
…cted avg speed

- this is a workaround until we get more thourough work done on the cost model
- this is related to #955 and #989
@emiltin
Copy link
Contributor Author

emiltin commented May 20, 2014

what's happening with this one?

@emiltin
Copy link
Contributor Author

emiltin commented Jun 3, 2014

do you plan to merge this?

@DennisOSRM
Copy link
Collaborator

Yeah, this is still on the plate. But as mentioned above the separation of deriving a general free-flow speed first and adjusting it in a subsequent step is important.

@DennisOSRM
Copy link
Collaborator

@emiltin would you mind rebasing this one onto develop? I'd like to move on this.

@emiltin
Copy link
Contributor Author

emiltin commented Jun 5, 2014

sure. should i fix the problem in current dev, that causes all speeds to be reduced by 4/5, even when there's no maxspeed? motorways currently end up with 72km/h when no maxspeed is specified. then maybe as a next step we can work on specifying all speeds in profiles as maxspeeds instead of averages.

@emiltin
Copy link
Contributor Author

emiltin commented Jun 5, 2014

ie remove this code from the end of car.lua, which is always called:

  -- scale speeds to get better avg driving times
  way.speed = way.speed * max_to_average_speed_factor
  if maxspeed_backward > 0 then
    way.backward_speed = way.backward_speed*max_to_average_speed_factor
  end

@emiltin
Copy link
Contributor Author

emiltin commented Jun 5, 2014

thus rebased, average speed on motorways are now 90, motorway_links 40, etc

@DennisOSRM
Copy link
Collaborator

should i fix the problem in current dev, that causes all speeds to be reduced by 4/5, even when there's no maxspeed?

That isn't a bug. That is by design.

@emiltin
Copy link
Contributor Author

emiltin commented Jun 5, 2014

ok i understand that we want to always start with a maxspeed (either specified in the profile, or read from the maxspeed tag), and then scale it down.

but isn't an average of 72km/h on motorways too low?

@DennisOSRM
Copy link
Collaborator

It is low, yes. The next step will be deriving highway-type specific scaling factors.

@emiltin
Copy link
Contributor Author

emiltin commented Jun 5, 2014

so what do we do with this PR - leave speeds low?

@emiltin
Copy link
Contributor Author

emiltin commented Jun 5, 2014

alright, reverted to alway scaling down speeds. then we can work on improving that as a next step.

@emiltin emiltin mentioned this pull request Jul 14, 2014
@emiltin
Copy link
Contributor Author

emiltin commented Jul 14, 2014

hi dennis, now that remove_geometry has been merged, what should we do with this pr?

@DennisOSRM
Copy link
Collaborator

@emiltin as argued above: move the scaling at the bottom. Doing it explicitly at the end of everything is superior to implicitly scaling in default speeds.

@agunnarsson
Copy link

Hi, I think it would be great if adjustments to the speed profile could be merged, since it would help removing a lot of defects on routes where it goes over links instead of keeping on the main road.

Renaming the scaling factor makes it's purpose more clear.

The rest of the changes I'm not so sure about. Isn't maxspeed from tags scaled twice? In that case why? Also a variable named max_speed is set to a scaled average speed value.

Don't know if setting the way.speed to max_speed at first and scale later is good either, if a clear separation is wanted. Is way.speed a speed limit or an average speed?

OT: Is maxspeed from tags used only when higher than the speed profile value? Is that correct even if the maxspeed is set to a correct lower value?

@agunnarsson
Copy link

Ignore my previous comment. I noticed speed profiles has been fixed by commit 5653516

I guess this request can be closed then

@DennisOSRM
Copy link
Collaborator

Thanks for the note @agunnarsson

@DennisOSRM
Copy link
Collaborator

@emiltin this PR has become obsolete, right? Or is there anything in it that should move into develop branch?

@emiltin
Copy link
Contributor Author

emiltin commented Oct 15, 2014

yeah. you chose to implement the same thing again :-)

@DennisOSRM
Copy link
Collaborator

Totally overlooked this issue when re-implementing :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants