News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

[Feature] Airplane runway choose

Started by Mariculous, January 11, 2020, 04:20:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mariculous

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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Mariculous

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.

prissi

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.

jamespetts

Quote from: prissi 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.

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

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

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.

Mariculous

Quote from: prissi on January 15, 2020, 12:55:12 PMOf 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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Qayyum

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.
ALLMYCONTENTISPUBLICDOMAINBUTNOEXPLOITATION

Simutrans - the open source Transport Tycoon Deluxe clone.