The International Simutrans Forum

 

Author Topic: How does routing work?  (Read 2413 times)

0 Members and 1 Guest are viewing this topic.

Offline T/C

  • *
  • Posts: 21
How does routing work?
« on: October 20, 2015, 02:04:01 AM »
The section "Routing of goods and passengers" in the overview of Simutrans-Experimental features says:

Quote
In Simutrans-Experimental, the journey time for each route is calculated, and passengers and goods will automatically take the route with the shortest journey time.

Is that true? I just watched as 7 passengers bound for a neighboring port got on a ship headed in the wrong direction. They will arrive at their destination in about two months, but if they had waited a few minutes for the next ship, they would have arrived there in less than an hour.

When I look at the journey times on the "Details" page of a station, it looks like the times reported are not the minimum journey time between two stations, but random journey times, as likely to reflect the least efficient routes as the most efficient ones. Furthermore, those journey times never seem to change. I've watched for years to see if specific journey times would eventually get corrected, and they never do.

In a typical station, about 90% of my potential passengers report "too slow", even though I've worked hard to give them fast routes to neighboring cities and beyond. I wonder if I'm seeing such high numbers of "too slow" not because I've made inefficient routes, but because Simutrans has incorrectly estimated the journey time of my routes. Likewise, I wonder if passengers board ships headed in the wrong direction because Simutrans has failed to estimate a faster journey time for the shorter route than for the longer route.

I find this all very confusing, and it has left me very uncertain about how to design a good transportation network. Can anyone shed light on what is going on?

-TC

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18620
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How does routing work?
« Reply #1 on: October 20, 2015, 08:47:45 PM »
That statement certainly should be true. It is not impossible that there are some bugs. Indeed, there is a a known bug in 11.35 (fixed for the next release) in which the times of extremely long routes are not properly recorded because of an integer overflow issue. You should, however, bear in mind that waiting time is taken into account, and, if a stop is very overcrowded, waiting time can be very high.

If, after reading the above, you think that you might have found a bug, can you upload a saved game to files.simutrans-germany.com and give a detailed description of how the problem can be reproduced?

Offline T/C

  • *
  • Posts: 21
Re: How does routing work?
« Reply #2 on: October 20, 2015, 11:53:45 PM »
I did some experiments and I have two things to report:

1) First, I believe I've found a bug related to the "Reverse route" button. I speculate that Simutrans calculates the journey time for a vehicle type and schedule, then assumes that journey time applies to every vehicle with that type and schedule regardless of whether the "Reverse route" button is checked.

The consequence is that if a vehicle's "Reverse route" button state is different from the button state of the first similar vehicle added to a route (at the time it was added), then the vehicle's journey times will be wrong. In one of my routes, the first ship had "Reverse route" checked when it was added. Now, every ship on that route has "Reverse route" unchecked, but it doesn't matter; in the station Details window, the journey times seem to reflect a reverse route, not a normal route.

Is this a known bug? I posted a save file called "E12.sve". To see the problem, look at lines North Sea Loop 1 & 2 and the ports they serve.

2) The Reverse Route thing explains some of the dysfunction in my system, but not all of it. Here's an example: Disregarding foot travel, the only destinations reachable immediately from Bagingston Dock are Beaingchester Dock and Markfield Dock. I would expect one of those two to be Bagingston Dock's fastest destination, even if the Reverse Route bug causes the other to be misreported. However, Simutrans thinks it can reach every other dock faster than those two. (I created an image to illustrate this, but I don't know how to make it show.) In other words, Simutrans knows that to get from A to D, it must pass through either B or C. However, it thinks it can get to D faster than it can get to either B or C. I don't have a theory to explain this; does anyone have any ideas?

-TC
« Last Edit: October 21, 2015, 06:28:17 AM by T/C »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18620
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How does routing work?
« Reply #3 on: October 21, 2015, 10:26:45 AM »
Can you upload your saved game so that I can investigate this more thoroughly (and, in particular, check whether this issue can be reproduced in the latest development version)?

Offline T/C

  • *
  • Posts: 21
Re: How does routing work?
« Reply #4 on: October 21, 2015, 03:45:29 PM »
Yes. I uploaded a file called "E12.sve" to files.simutrans-germany.com. The problem is most evident in the passenger ship lines, such as North Sea Loop 1 & 2. The travel segment I use most often as a test case is the journey from Queensingworth Dock to Didley South Dock, which is reported as requiring 10:53:06, but really should be closer to 0:30:00. There are many ways to reproduce odd behavior by clicking "Reverse route" and/or by changing schedules; here is one specific example: Send all ships on the line North Sea Loop 2 to the depot and clear their schedules. Then assign one of those same ships back to North Sea Loop 2. The Queensingworth Dock to Didley South Dock journey time will immediately change to a much lower number.

-TC

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18620
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How does routing work?
« Reply #5 on: October 27, 2015, 07:29:49 PM »
Can I check whether this remains for you at 10:53:06 into 1761? Running this on the current development version, it is reduced to 5:35:something by 1761. If it stays the same for you, that suggests that the issue is something specific to the older version; I know that I had fixed quite a few routing issues in that version. The 5:35 time would be an amalgam of the correct calculated time and the old incorrect stored time.

Offline T/C

  • *
  • Posts: 21
Re: How does routing work?
« Reply #6 on: October 28, 2015, 03:02:40 AM »
Yes. I just loaded E12.sve and let it run through 1762, and I can confirm that the time from Queensingworth Dock to Didley South Dock remains unchanged at 10:53:06 throughout all of 1761.

-TC

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18620
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How does routing work?
« Reply #7 on: October 28, 2015, 09:49:46 AM »
Thank you for the confirmation: that is helpful.