The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: Mariculous on June 03, 2020, 11:27:21 PM

Title: Bug? Passengers prefer the lower class in cases where I would not expect this
Post by: Mariculous on June 03, 2020, 11:27:21 PM
Those ew passengers that use my intercontinental shipping line will very often travel in Low class, although they could afford High class, whilst both classes are too uncomfortable for a 33 hour long journey.
I'd expect passengers that can afford the higher class to use it, as it at least allows them to be comfortable for 8:08:34 rather than only 1:36:00.

Is that a bug, intended or "simply how it work"?
In the first case I might try to set up a minimal reproduction case.
Title: Re: Bug? Passengers prefer the lower class in cases where I would not expect this
Post by: jamespetts on June 04, 2020, 01:40:47 PM
Thank you for the report: there is an algorithm that calculates the comfort difference based on the journey time and passengers randomise their comfort preferences for this purpose. For such long voyages, it is possibly suspect that passengers that can afford a high class are taking a low class, so a minimal reproduction case would be helpful for investigation.
Title: Re: Bug? Passengers prefer the lower class in cases where I would not expect this
Post by: Mariculous on June 05, 2020, 12:47:50 PM
Wow, 64 kb are extremely restrictive!
See the following savegame: https://simutrans-germany.com/files/upload/class_test.sve
Just to point out a few ships where wealthy people were too stingy to pay for the higher class, although it's nearly a 3 day trip across the ocean:
(22)
(25)
(26)
(32)
(33)
(35)

There are also cases where wealthy people do actually use the higher class, so this just a list of the negative examples.

In this specific case, I'd expect them to always, or at least by-far most often prefer the most comfortable affordable class, as the journey time is extremely long and the relative max comfortable journey time in betwen the two classes is significiant either (1:43:12 against 8:08:34)

It's hard to tell a "general" expectation or even a formula on how likely it will be to pick one class or the other one, nor I do know the currently implemented one, but the comfort difference between the classes should always be just as iportant as the journey time itself.
Title: Re: Bug? Passengers prefer the lower class in cases where I would not expect this
Post by: jamespetts on June 05, 2020, 10:29:06 PM
Thank you for the reproduction case: this was helpful. I think that I have found and fixed this. What appears to have happened is that schedules with waypoints incorrectly failed to record estimated arrival times in some cases. At the part of the code where passengers choose which class to take and whether to board the current convoy, the system relied on estimated arrival times at the destination; where these were not present, the time was calculated as being the present, such that the journey time was zero and comfort was thus irrelevant.

I have now fixed the problem causing the arrival time data not to be stored, and also added a heuristic based on average speed to estimate the arrival time where these data have not been stored in the past. In these conditions, the passengers on the long sea voyage will always choose the highest class that they can afford.
Title: Re: Bug? Passengers prefer the lower class in cases where I would not expect this
Post by: Mariculous on June 05, 2020, 11:06:33 PM
Great!

Sounds like this might also have caused the bug in which passengers boarded a line they shouldn't board, so you just fixed two in one :)
Not sure if that was a bugreport in the forums or I had just read this in the chat, I'll figure it out.
Title: Re: Bug? Passengers prefer the lower class in cases where I would not expect this
Post by: jamespetts on June 05, 2020, 11:43:59 PM
Yes, it is possible that this had caused other symptoms; I should be grateful if you could let me know if anything else has been fixed.
Title: Re: Bug? Passengers prefer the lower class in cases where I would not expect this
Post by: Mariculous on June 06, 2020, 12:47:40 AM
I guess that's the one I had in mind:
https://forum.simutrans.com/index.php/topic,18873.0.htmll