The International Simutrans Forum

 

Author Topic: [Bug] waiting time not correctly calculated.  (Read 7164 times)

0 Members and 1 Guest are viewing this topic.

Offline SuperTimo gb

  • *
  • Posts: 62
  • Languages: English, French
[Bug] waiting time not correctly calculated.
« on: July 07, 2019, 01:51:13 PM »
I am having some trouble with some routes on the Bridgewater-Brunel server. I have a route where trains were stuck for a long period in game but I have since fixed this. However despite the game running through the pathfinder multiple times the waiting time for the route is stuck at 7 hours despite the frequency being much higher than this. This was previously a very highly used route and now it sees next to no passengers whatsoever.



As you can see in the image below there is a service every 25 mins.

Offline ACarlotti

  • *
  • Posts: 483
Re: [Bug] waiting time not correctly calculated.
« Reply #1 on: July 07, 2019, 03:19:11 PM »
However despite the game running through the pathfinder multiple times the waiting time for the route is stuck at 7 hours despite the frequency being much higher than this.
The path explorer (for determining optimal passenger routes) does not recompute the waiting times, but rather uses the waiting times already stored in the halts. I think this data is updated when convoys depart/arrive or at month end; running the path explorer is irrelevant here.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug] waiting time not correctly calculated.
« Reply #2 on: July 07, 2019, 10:16:45 PM »
Thank you for your report. I am afraid that I cannot at present debug any issues where the reproduction case is the Bridgewater-Brunel saved game, as my computer needs replacing before I will have enough memory to run this game.

Offline freddyhayward au

  • *
  • Posts: 54
  • Languages: EN
Re: [Bug] waiting time not correctly calculated.
« Reply #3 on: July 08, 2019, 02:05:58 PM »
The path explorer (for determining optimal passenger routes) does not recompute the waiting times, but rather uses the waiting times already stored in the halts. I think this data is updated when convoys depart/arrive or at month end; running the path explorer is irrelevant here.

In that case the problem must be something preventing these times from updating when they are supposed to. I've had the exact same issue (https://forum.simutrans.com/index.php?topic=19090.0) as well for a few years now.

Offline Ranran jp

  • *
  • Posts: 483
  • Languages: ja
Re: [Bug] waiting time not correctly calculated.
« Reply #4 on: July 08, 2019, 02:39:56 PM »
I used this patch to test the waiting time like this to see if station has a class connection with each station.  :-[
(The code is here.)
This shows the waiting time for each class registered in the station in grey.
The left side is the low class.


The time next to the hourglass is the average wait time currently visible to the player.
Displayed time is not an average of classes, it seems to always show the waiting time of highest class. And this keeps taking the same value as highest class even if time passes.  ???
The waiting time for the highest class may be shorter or longer than the average.
For example, check the passenger connection to Eastham station.
Very high class has very long waiting time compared to other classes.
Sometimes this time is very different from convoy's service frequency, so I have no idea how it is calculated, but I'm guessing this waiting time may be longer if there are fewer passengers/mail in the highest class.
(Could it be based on the actual travel time of each class?)


EDIT:
That image has some parts that have not been updated yet and may be different from some of the highest classes, but as time progresses, all values will be the same with highest class.
« Last Edit: July 09, 2019, 09:36:07 AM by Ranran »

Offline Matthew gb

  • *
  • Posts: 227
    • Japan Railway Journal
  • Languages: EN, some ZH, DE & SQ
Re: [Bug] waiting time not correctly calculated.
« Reply #5 on: July 08, 2019, 04:26:24 PM »
The data in that window is very interesting.  :lightbulb: Almost shocking!

The really positive side is that it reveals how sophisticated James' passenger classes system is and how clever the path explorer is. Thank you to James and everyone else who has worked on these developments.

The discrepancy in the data also suggests that it will be good to improve the UI so that players can harness the full power of these systems. It confirms that Ranran's Station Details patch is a step in the right direction.

Offline freddyhayward au

  • *
  • Posts: 54
  • Languages: EN
Re: [Bug] waiting time not correctly calculated.
« Reply #6 on: July 15, 2019, 03:42:47 AM »
I believe I've distilled this problem to its essentials. The attached save has two stops linked by a hackney carriage (each with a capacity of 2 passengers per convoy) line running every 16 minutes. Initially, the line attracted 66 passengers until reported waiting times rose to about 34 minutes before passenger numbers dropped to 0 and waiting time remained at 34 minutes. I then deleted and replaced the two stops and the line attracted another 44 passengers until wait times permanently rose to 73 minutes and passengers dropped to 0.

Offline freddyhayward au

  • *
  • Posts: 54
  • Languages: EN
Re: [Bug] waiting time not correctly calculated.
« Reply #7 on: July 24, 2019, 09:49:10 PM »
As a temporary workaround before the issue itself is addressed, could players be given a "reset waiting & travel times" or similar button in the station details window? The effect can already be achieved by deleting and replacing stations but this has a financial cost and is difficult in complex railway stations.

Offline ACarlotti

  • *
  • Posts: 483
Re: [Bug] waiting time not correctly calculated.
« Reply #8 on: July 25, 2019, 01:44:35 AM »
In contrast to my earlier fix, this bug was caused by the change I made last month to how waiting times and connexion data were stored. In the process I unintentionally changed the code in haltestelle::new_month to increment a copy of the variable holding the number of months without new waiting time data, instead of the updating the original variable.
Code: [Select]
-                       FOR(waiting_time_map, iter, *waiting_times[category][g_class])
+                       FOR(waiting_time_map, &iter, *waiting_times[category][g_class])

I still think there is significant scope for improvement to the way waiting times are computed, so that they are still updated accurately even when there have been no passenger departures. At present (after returning to the intended behaviour) a severely overcrowded line will need to see a whole calendar month with no journeys before it resets to waiting times based on frequency rather than measured passenger waits. This possibly ties in with changes I would like to make in the long term to how the path explorer works.

The fix for this is also on Github. Thanks for reporting the issue.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug] waiting time not correctly calculated.
« Reply #9 on: July 27, 2019, 09:54:42 PM »
Thank you very much to A. Carlotti for the fix to this, which I have now incorporated. As noted elsewhere, I have been very busy in the last few weeks and also hampered in working on Simutrans by the lack of availability of components to build the new computer that I need.

I do agree that it would be most helpful to have a UI showing the waiting times for each class separately: how to do this clearly and neatly is quite a challenge. If any of the UI focussed people were to look into this, this would be extremely helpful.