-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature requrest: Estimate and record trip travel times #45
Comments
They are available :)
This is already implemented.
For this, so-called "instantaneous travel time" may be useful. |
I missed that, thanks!
Do you think it would be useful to have a function that returns that total value for the shortest route from some node A to some node B? For example, if I'm an agent deciding to go by car or by bike from A to B, I might want to check what the current travel time is from A to B by car to base my decision on. |
That is not difficult. You can create a graph whose link cost is
|
I would love to have this built-in in UXsim. I will take another look at this when I'm back from vacation next week, but if you have ideas in the meantime, please share! |
I have updated For the use cases, see UXsim/tests/test_other_functions.py Lines 195 to 306 in 2851589
|
@toruseo What's the difference between Edit: The first is free-flow travel time, the other on the travel time at some point? But that point can also be now or in the past? A bit more documentation on these functions would be useful I think. |
This is not an user friendly method currently. Takes a while to configure and needs way too many parameters, which are error prone. Like which time do I need to use?
I would suggest adding two functions, directly to the def free_flow_travel_time(self, origin, destination):
def estimated_travel_time(self, origin, destination, time=self.T): Where Because you don't need to know the exact route, you can use optimized functions like Adding these two functions reduces the potential error of parsing world objects, or using the wrong time. |
|
You dont need, but others may need. |
Thanks for getting back, and the extensive explanation. I will try to get it working again, but because there are so many variables and code paths is relatively difficult to debug. I completely understand that there are other use cases and some people indeed may want routes as output. I think in a simulation library where performance matters, especially with a function that needed to be called once per trip, it might be nice to have optimized, specialized functions in some cases. Two questions:
|
For now I worked around it. For reference: EwoutH/urban-self-driving-effects@dd93ee0 |
Because it is not required for the default simulation logic. I want to make the As a side note, one of my design philosophy on this point is that we should not consider a route choice problem explicitly. If we enumerate routes, it becomes untractable very quickly due to the exponential number of routes in a network. Route choice models without route enumeration such as recursive logit is a bit advanced and computationally costly, and the IIA property will be problematic (there are several workaround for IIA, but they are more complicated). Thus, I believe the current stochastic DUO is the most balanced solution, and necessary functions are provided by the So, my stance is that advanced route choice or other models should preferably be defined outside of the simulation by the user. I believe there are sufficient interfaces for that. Of course, I highly welcome if such models are added to the
All-to-all shortest path search with time-dependent data would be useful. I think they can be coded by modifying the current ones.
Lines 1877 to 1878 in 2e61fd5
|
Thanks for getting back, it's appreciated!
I understand that, and I think that's a good approach. Could we make a second module that can be imported/inherited into World specifically for travel time lookups and calculations? Like a kind of extension? That might be very useful for certain research.
I fully agree! However, to facilitate mode choice properly (which I think is something UXsim could be very useful for?), it would be nice to have a fast way to get expected travel time for a single route or for the whole network.
I think I implemented that successfully here. Feel free to incorporate it somewhere in UXsim!
Thanks, this helps. And every time some time value is requested, it's generally |
You can get on-going simulation variables by code something like this:
Note that this may not be executable as I havent debug. For a fully working example, see https://github.com/toruseo/UXsim/blob/main/demos_and_examples/example_08en_signal_reactive_control.py Unfortunately I found a small bug in
Generally yes. |
FYI I will be very busy in next few weeks and dont have time to code. |
No worries, thanks for all your time and effort so far! New academic year starting? |
I believe this is completed. If not, plz re-open |
It would be a very useful feature for me to be able to estimate and record travel times of trips in UXsim.
The first one can be used to make decisions on (for agents making a mode choice for example), the second can be usefull as metric / KPI.
The text was updated successfully, but these errors were encountered: