Skip to content
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

"Pulling" buses to meet commuting demand (aka "service self-balancing") #12

Closed
Vectorial1024 opened this issue Mar 25, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@Vectorial1024
Copy link
Owner

Vectorial1024 commented Mar 25, 2022

As mentioned in #5:

Short-workings

[Operate from midway bus stops] is the same concept as short workings where you have a bus line that does multiple schools and letting them off at residential areas.

I have a rough idea from my observation on my save file: we should be able to simulate some sort of "asymmetric service headway".

What do I mean by "asymmetric service headway", for example, is some bus lines serving business districts. (This may be more obvious with e.g. Real Time installed.) There is always a certain direction of commuting at certain hours, eg in the morning ppl move from residential to commerial, and in the evening, ppl move the other direction. Even when I increase the bus budget, the commuter service is unstable because there are about 50% of buses stuck at the direction where there are less passengers. Or, for some reason the buses simply prefer to start service in a certain direction.

In real life, when it comes to commuter hours eg in Hong Kong, very often we see operators pull a few buses on the opposite terminus back to service on other direction. The bus would still belong to the same line, but it will not be used to transport passengers until it reached the other side of the line ("私牌回車"). Or, the bus would be pulled to help clear out passengers waiting at busy stops ("私牌中載").

This is an advanced feature; would be interesting to see this implemented.

For example:

  • If the bus is empty:
    • Check if it should be "pulled to other places"
    • If yes, then set the next stop appropriately; let the bus be "pulled" to a better position

The above cannot happen too frequently otherwise too many empty buses will be reassigned too frequently, and some waiting passengers will get unfairly reduced services. Perhaps I set it to occur max once per minute per line, and perhaps the max number of buses being pulled depends on the budget %.

Perhaps similar to #9, I also set it such that this behavior can only occur when the budget is above 100%.

@Vectorial1024 Vectorial1024 added the enhancement New feature or request label Mar 25, 2022
@Vectorial1024 Vectorial1024 added the focus A focus for the short term: is WIP or being planned label Jul 20, 2022
@Vectorial1024
Copy link
Owner Author

I thought about it, and binding this feature with mechanics like "count the time in the game and then do X" will just make this mod much more error-prone (eg the Real Time mod) with no obvious benefits. But I still want to do asymmetric bus-pulling.

I have therefore revised the plan.

Instead of moving buses every minute, perhaps it is better to perform some checks when buses arrive at termini. Something like this:

  1. A bus arrives at a terminus
  2. Look at the bus line; identify the "directional segments" and count how many people are waiting for the bus in each segment
  3. Don't do it if any of the following conditions is true:
  • The bus line only has 1 segment
  • The busiest stop on the line has < 30 passengers waiting
  • Budget of the line is < 100% (not sure if should stay with this?)
  1. Calculate a bunch of numbers, using a combo of odds, arctans, probabiity, such that:
  • If a segment has smallest average number of pax waiting, buses will not be pulled from that segment
  • For every other segment, there is a chance a bus will be pulled to other segments, where the segment with the most number of pax waiting will get the highest possibility of getting extra help
  • All these bus pulling must not affect the ability for buses to serve the entire line; we cannot allow all buses to go to the other side of the line just because at that very moment that segment has the most people

The details still need to be sorted out, but essentially the proposal is this.

@Vectorial1024 Vectorial1024 changed the title "Pulling" buses to meet commuting demand "Pulling" buses to meet commuting demand (aka "service self-balancing") Jul 22, 2022
@Vectorial1024
Copy link
Owner Author

The thing kinda works now.

Now I will need to balance the numbers, ensure correctness, add in the config, etc etc.

@Vectorial1024
Copy link
Owner Author

Again, it kinda works now, but there is this one feature we must implement: if we are telling a bus to redeploy, it must drop off all passengers at the terminus before redeploying. Currently there are observed cases where buses redeployed with their pax still on board, which mostly prevented those pax from alighting and reducing the efficiency of the system by a lot.

@Vectorial1024
Copy link
Owner Author

It works quite well, as seen in both tthe testing map and a "real" map. There are other improvements that can be made, but that is out of scope of this feature.

I have extended this to also cover trolleybuses, even though it might have limited effectiveness because trolleybuses are limited to stay in their lane.

This feature should have no compatibility problems with IPT2 and TLM. It is tested with TLM and is "proved to be correct by code reading" with IPT2.


The update was pushed, and this feature is now available on Steam.

Closing this. If you found problems with this in the future, open new issues instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant