## News:

Congratulations!
You've won the News Item Lottery! Your prize? Reading this news item!

## Passenger distribution

Started by neil, December 04, 2022, 10:52:57 PM

0 Members and 1 Guest are viewing this topic.

#### neil

I have a passenger bus line which runs from station A to B to C to D, all of which accept passengers.

Station A has a capacity of 192 and there are 150 passengers waiting there, 50 waiting to go to each of the other stations.

An empty bus for the line with a capacity of 60 passengers arrives at station A. It fills up with 50 passengers for B and 10 for C then sets off full.

Why does it fill with passengers for the nearer stations? Surely in real life it would average out to 20 passengers for each of stations B, C and D.

Can I tweak a setting to change this behaviour?

(Standard Simutrans 123.0.1, r10421, pak128 Britain)

#### ampersand

Quote from: neil on December 04, 2022, 10:52:57 PMWhy does it fill with passengers for the nearer stations? Surely in real life it would average out to 20 passengers for each of stations B, C and D.
I am not this sure whose elbows win in real life, but when a convoi is to be loaded:
• stops are sorted in the same order as they appear in the convoi's schedule
• if there is free place for each type of cargo waiting to the first stop on the list, it is picked up from the station to the convoi
• if there is still free place the same is checked for the next stop and so on.
It is the same priority as in the order of stops. May be solved in a few ways on a circular line you mentioned. Just in case, but I am sure you have already realized that more than one convoi can be assigned to a line, or follow an invidual schedule.

#### neil

Yes, I understand how it works with stop order, assigning more than one bus to the line etc but my point is that it's not realistic.

I'm a programmer myself (although I'm not familiar with whichever language Simutrans is written in) and I can't believe that it would be difficult to make the distribution work by averaging out the passengers between the remaining stops ... with a bit of randomisation to allow for who has the strongest elbows, maybe

#### Combuijs

I'm a programmer myself too, and I can assure you that it is not as simple as you think (Simutrans is programmed in C++). I know that in the past there have been several attempts to tackle this without success. Note that the same algorithm is used for goods and goods don't have elbows  . Note also that evenly distribution makes things even less predictable for the designer of the transport network. In your example you could also have an express train running from A to D directly and in that case you don't want the passengers to D take the slow ABCD train. In practice even in real life it's very difficult to predict passenger behaviour...
Bob Marley: No woman, no cry

Programmer: No user, no bugs

#### neil

Yep, good point about the express train scenario.

Perhaps I'll have to learn C++ and (try to) fix it for myself. It can't be more difficult than Univac Assembler or ICL PLAN, the languages on which I cut my coding teeth a lonnnnnnnnnng time ago

#### neil

OK, I've output "Hello world!" in C++

Where's the Simutrans source code?

#### savingskin

#6
I'm also learning C++ and managed to fix it myself.

happy wheels