The International Simutrans Forum

 

Author Topic: [Feature] Airplane runway choose  (Read 301 times)

0 Members and 1 Guest are viewing this topic.

Offline Freahk

  • *
  • Posts: 450
  • Languages: DE, EN
[Feature] Airplane runway choose
« on: January 11, 2020, 04:20:39 PM »
Hey there and be warned, it's Feature request Saturday.
Let's start with the first one!

What's the Request?
Airplanes should be able to choose an alternative runway if their original one is occupied.

Why?
While in Simutrans airplanes are a pretty strong type of transport for long distances at a small to medium scales, they quickly suffer from bad scaling when trying to setup hubs.
Terminals are not an issue. One can simply add new ones and transfer times will also still be fine with any efficient layout.
Runways, however are a bottleneck, especially at large airports with long-distance service.
Most high capacity planes will require long runways which further decrease airports throughput (measured in number of airplanes taking off and landing)

To scale an airport one has only three choices:
1. Build another airport nearby and link them with some form of rapid transport (high frequencies, quick acceleration)
2. Add a second runway and assign one dedicated to landing and the other one dedicated to takeoffs
3. Set waypoints to explicitly assign a runway.

Each of these have their advantage but none of these can provide dynamic load balancing for runways just as choose signals can for railway stations.

How?
Well, the following is just a suggestion:
- We need to know which runways are connected to our airport.
- Each runway needs a counter, counting how many airplanes currently want to use it.
- A starting airplane will choose its runway depending on the distance from the terminal to that runway, the counter and the runway length (shorter is better if length is sufficient)
- A landing airplane will choose its runway depending on the distance from the runway to the terminal(waypoint), the counter and the runway length (shorter is better if length is sufficient)
- An airplane that has chosen a runway will increase runways counter by 1
- An airplane leaving a runway (clearing the reservation) will decrease the counter by 1
- Airplanes can never choose runways that are too short
- Airplanes can frequently recalculate their prefered runway to rebalance e.g. if many small airplanes suddenly arrive, some of these will chose large runways. If shortly after this many airplanes arrive that require that large runway, recalculating will effectively send many of the small airplanes from the large oneway to the small one.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19149
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Feature] Airplane runway choose
« Reply #1 on: January 12, 2020, 12:18:59 PM »
This is a complex mechanic that is likely to take a considerable time to implement. It is thus likely to be an extremely long time before I am able to implement this, especially as this is not necessary for airports with 2 or fewer runways, as with 2 runways, one can have one landing runway and one takeoff runway by careful use of one way signs for taxiways.

An alternative way of dealing with large airports in Simutrans-Extended is to split them into two neighbouring airports, e.g. "Panfont H. J. Malthaner Airport Terminal 1" and "Panfont H. J. Malthaner Airport Terminal 2". Each terminal would have its own extension buildings and aprons and its own 1-2 runways. Perhaps terminal 1 might be the long distance terminal and have two runways for large numbers of flights, whereas terminal 2 might be for domestic flights and have one, shorter runway for a smaller number of flights.

A further advantage of splitting airports into two is that it reduces the transfer time for all passengers, as each individual airport has a smaller size, and it is this size that determines the transfer time. One can then have a 'bus or light rail/tram/maglev/rail shuttle between the two, as is often the case in reality.

Offline Freahk

  • *
  • Posts: 450
  • Languages: DE, EN
Re: [Feature] Airplane runway choose
« Reply #2 on: January 12, 2020, 01:35:19 PM »
I am aware this is not a simple approach but expect it to be quite powerful while not being too complex. I can't imagine any less complex approach providing dynamic load balancing.
Your alternatives mentioned above, I had listed these and an additional alternative in my original post, all of these don't provide dynamic load balancing.
This is a problem, especially for weaker airplanes that can't reach their maximum speeds or will need long times to reach it, as it will cause high, load dependant, variations in flight time which makes it impossible to efficiently schedule arrivals at airports.
Additionally taxiing times at airports will greatly vary, depending where the airplane stopped, which even makes it hard to schedule takeoff times.

To compare with rail operation, the dynamic approach would be choose signals, while the static one is scheduling trains to fixed platforms.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9642
  • Languages: De,EN,JP
Re: [Feature] Airplane runway choose
« Reply #3 on: January 14, 2020, 02:26:54 PM »
There is a simple balancing code for runway choose in Standard that increases throughput (but only after some time, because it tries to even out the runway usage depending on planes taken off/landing so far). It simply increases the routing costs on runways according to past usage.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19149
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Feature] Airplane runway choose
« Reply #4 on: January 14, 2020, 02:40:32 PM »
There is a simple balancing code for runway choose in Standard that increases throughput (but only after some time, because it tries to even out the runway usage depending on planes taken off/landing so far). It simply increases the routing costs on runways according to past usage.

Interesting. May I ask how long that this has been in the code and where in the code that this logic can be found?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9642
  • Languages: De,EN,JP
Re: [Feature] Airplane runway choose
« Reply #5 on: January 15, 2020, 12:55:12 PM »
It is in simvehikel.cc air_vehicle_t::get_costs() On a runway the routing costs is multiplied by 9*number_of_convois passed last month. Of course one has to do some balancing that the runway have the same length; otherwise the shorter runway will be preferred. Also already reserved runways get a malus. Look for lines in simvehikel.cc which are changed with revision 8454 (actually anything in simvehivel air_vehicle_t which changed after 7500 or so belongs to it, because the first attempt had some issues.)

Unfourtunately there had been translations patches (and bug fixes, and the priority signals) but here is a diff of only the aicraft part, which could give you an outline of the idea.

Offline Freahk

  • *
  • Posts: 450
  • Languages: DE, EN
Re: [Feature] Airplane runway choose
« Reply #6 on: January 15, 2020, 01:05:20 PM »
Of course one has to do some balancing that the runway have the same length; otherwise the shorter runway will be preferred.
Which is not always desirable in extended as different airplanes require different minimum lengths and one most likely does not want to maintain long runways for small airplanes.

However, I guess this preference has a rather positive effect as it will not congest long runways with rather small airplanes, except maybe for very highly frequented small runways and lowly frequented large runways, in which case it is perfectly fine for some of the smaller airplanes to use the larger runway.

However, a "good" number for the magical 9 is quite important for this to work well, so I guess tweaking that magic number will need empirical observation ingame.

This mechanic won't perform as good as the suggested one, as it works on average load instead of current load, but it's also rather simple and efficient, so we should definitely give it a try.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19149
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Feature] Airplane runway choose
« Reply #7 on: January 16, 2020, 12:32:23 AM »
I have been attempting to integrate this, but I have had to abort work on this indefinitely, as the changes in this code conflict with changes in the code for the aircraft flying height logic and runway length logic such that it is not simply a matter of searching and replacing relevant parts of code, but requires me to understand how all three systems work, which would take such a long time that this must go to the back of the queue of tasks, which means that, for my own work, this is probably at least 10 years away from being a priority high enough for me to recommence work.

If anyone else would like to attempt to integrate this code from Standard, I should happily incorporate this if the integrated version is working.

Offline Qayyum

  • *
  • Posts: 148
Re: [Feature] Airplane runway choose
« Reply #8 on: January 16, 2020, 04:57:30 AM »
Jamespetts, have you attempted to do changes to code sandbox-style? I mean, fundamentally change the code by re-writing, but you put what you want to put, albeit in the code-culture of Simutrans. Some of the tasks, cannot be done by hacking and copy-and-paste.