Jump to content


Photo

How FSX makes decisions


  • Please log in to reply
10 replies to this topic

#1 Burkhard

Burkhard

    Product Support

  • Moderators
  • 14,232 posts
  • LocationIn front of my computer

Posted 04 December 2008 - 09:14 AM

Dear friends, there have been several topics on this forum now about specific decisions that FSX takes related to AI traffic, from parkings over runways to directions. Therefore I discuss here how, according to all I know, FSX makes decisions, and why they are very different to what a human being would decide.

In principle, there are two ways to decide. The usual way we do it is to estimate consequences, and our human brain is very powerful to habe a rough estmate of future consequences due to past experience, and we react mostly out of our subconciessness ( that uses 95% of our brain ) than out of our intelligence ( that uses 5% only ).
To bring this onto the computer, the computer would have to calculate what will happen in advance, so not only the current frame, but also the next 10 minutes minimum, at 25 frames per second, 1500 frames per minute, so the next 15000 frames. We know now that current hardware has problems to get one frame done in time - to have a real concept of future our computers would need to be 15000 times as fast as they are now. And if they were, I assume you would want to have more details and not just a better basic logic...

The alternative are weighting algorithms. Let me describe how FS calculates which parking should be used for an AI plane when it has landed and shortly stops on the runway.

FSX loops over all parkings. If they are used, they get the weight 0 and the loop goes over to the next one. Otherwise, from ATC parking code ( airline code, if programmed into the aircraft and the parking ), parking type, parking radius, and distance from the current location a weight is calculated. The detail of this formula I do not know, but every free parking gets a weight - 0 if it is significantly too small for the aircraft. Parking codes have the largest weight.

This weight always is a compromise, it may well be that on a crowded airport ( especially if some parkings are assigned to airlines ) a gate fitting to the aircraft in size nearby gets a higher weight as a far away cargo parking that is larger, despite it is a cargo plane, but it is a rather fast algorithm.

Now, if the maximum weight is 0, there is no solution where to park the aircraft, and it gets deleted. The art of AI programming is to have this to be a rare case with normal traffic settings ( 50% AI density) , and in MyTraffic a lot of work has gone into this optimisation.

It should be mentioned that the same, looping over all aircraft that are on the airport, is done during the fast phase of scenery loading. This means that the first aircraft will get the best fitting places, without looking if other aircraft would fit there better.

Still, on larger airports this loop can go over hundred and more parkings, so we speak about several thousand calculations that have to be done. Each subsystem in FSX only gets a certain amount of CPU time warrented - so if you have no spare CPU time, it will happen that this calculation gets aborted before all the parkings are evaluated, in this case the first best will be used. This is what happens if you have the frame delimiter above your actual frame rate, and especially at unlimited. The loop will terminate after a few parkings have been evaluated, and what happens will be completely random.

Other decisions, like which runway gets used, etc, use similar procedures. Since they do not calculate in advance the consequences, they work astonishingly well, with a low failure rate of a few % only - but these failures will happen, and there is no way around them.
  • 0

#2 frontendrob

frontendrob

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 04 December 2008 - 04:52 PM

More than once it has happened to me that an aircraft will sit on the runway but not take of. ATC tells me to hold position. After a few minutes, the plane gets deleted. Nothing was blocking the runway, and this happens right 15 minutes into the sim, with enough cycles left over for the AI. The last time I remember, this happebed at EDFH, a Ryan 738 behaved as described.
  • 0

#3 Burkhard

Burkhard

    Product Support

  • Moderators
  • 14,232 posts
  • LocationIn front of my computer

Posted 04 December 2008 - 10:37 PM

One known reason for this to happen is overflow of the ATC stack. ATC can only queue a limited number of calls, if there are too many some get forgotten, and the aircraft will just be forgotten. I would not have expected this at Hahn, since ATC is rather quiet there compared to other airports.
  • 0

#4 flying-w

flying-w

    Advanced Member

  • Members
  • PipPipPip
  • 1,908 posts
  • LocationEGBE - Warwickshire, England

Posted 11 November 2009 - 09:58 AM

A piece of research I'm doing for STB involves predicting how FSX selects a runway for use for a given AI (and user aircraft). Let me start by saying what I do know:
a) The coordinates of the AI/User aircraft
B) A list of runways for all the world's airports, including:
i) The runway threshold coordinates (AFD "Start" point)
ii) The orientation of the runway
iii) Whether it is open, closed for takeoff, closed for landing
c) The direction of the wind.

So how does FSX determine the runway, especially if there are multiple choices? My guess is the closest available runway is chosen (closest being "as the crow flies") for both an arrival request and a departure request. "Available runways" depend on closed state and wind direction.

Any comments?

Thanks
Simon
  • 0

#5 Burkhard

Burkhard

    Product Support

  • Moderators
  • 14,232 posts
  • LocationIn front of my computer

Posted 11 November 2009 - 11:26 AM

The same way as all decisions.

For each runway, a probabilty is calculated.

Open/close information gives a certain amount of weight ( a big one ), wind direction gives a big weight, and distance from aircraft to start point enters in this. Maybe also length requirements, for sure surface pproperty compared to aircraft requirement, maybe more... All this gets summed up and the one with the smallest weight will be used.

In case of Heathrow, with two runways parallel of same length and surface and width, if both are open this comes down to the distance only, with more complicated layouts this may depend on wind direction, wind speed for two non parallel runways that have similar distance from the aircraft. Usage of runways is not taken into account, so FSX does not try to prefer unused runways.
  • 0

#6 Daniel42

Daniel42

    Advanced Member

  • Members
  • PipPipPip
  • 279 posts

Posted 19 January 2010 - 10:18 AM

I'm alive :) Apart from flying a bit and giving support for my own add-on, FSX was gathering dust for me.

Recently I picked it up again and started browsing some forums again, we'll see what happens.

On topic... I've done a lot of research on how FSX will assign runways. The two most important things to remember:

1) There is a bug in it, related to closed runways. For both the primary and secondary runway start, FSX will check the 'Closed for Take-off' flag for the primary. (There may be bugs in this line as well, since I don't recall exactly what got checked instead of what, but there is a mix up there)

2) The assigning algoritm is (totally) incompatible with the crosswinds/Star technology. The FS algorithm is based upon the fact that it only has to make a decision between true parallel runways. Tying non parallel runways together using the Star technology breaks the algorithm. Ever wondered why you had to taxi to a runway on the other side of the field while you are standing almost next to an available runway? It's a side effect of the Star technology. FSX will send you to the closest available runway. But closest as in: the shortest distance between you and the great circle through the runway (or the centerline of the runway extended all around the world). Now this works ok if all available runways are truly parallel. But if they are not, you could be 300 feet from runway 18, but still be send to runway 27, 5000 feet away, if the extended centerline of that runway passes within 300 feet from your parking position.

The algorithm itself... have to look it up, but it involves the wind (which is only evaluated for the first runway in a group, again since FSX thinks all runways in a group are really parallel) and then the type of engine and the weight of the plane to determine the required length of the runway and, as said, the distance between the plane and the extended centerline of the runway.

Another bug is the distance between the runway start and the plane that is needed before a plane will ask for T/O clearance. This threshold is too small for for instance 18C at Schiphol. Planes will taxi there but just hold short because the T/O request is never triggered.

Daniel
  • 0
Daniel van Os
Disposition Software Development
KvK 08165245

#7 Burkhard

Burkhard

    Product Support

  • Moderators
  • 14,232 posts
  • LocationIn front of my computer

Posted 20 January 2010 - 02:26 PM

Thanks.., but since there is no other simulator available for the next three years this is a given feature, not a bug...
  • 0

#8 Daniel42

Daniel42

    Advanced Member

  • Members
  • PipPipPip
  • 279 posts

Posted 22 January 2010 - 01:33 PM

Each subsystem in FSX only gets a certain amount of CPU time warrented - so if you have no spare CPU time, it will happen that this calculation gets aborted before all the parkings are evaluated


Is this perhaps documented somewhere? I'd be quite interested the find out a bit more about this.

Daniel
  • 0
Daniel van Os
Disposition Software Development
KvK 08165245

#9 Burkhard

Burkhard

    Product Support

  • Moderators
  • 14,232 posts
  • LocationIn front of my computer

Posted 23 January 2010 - 08:05 AM

Some of the blogs of Phil Taylor discussed it, other things are from a newsgroup that closed some years ago...

But if you are a programmer, you know this is the fastest way to do things, and if you make realtime programming, that is standard technology...
  • 0

#10 Daniel42

Daniel42

    Advanced Member

  • Members
  • PipPipPip
  • 279 posts

Posted 02 February 2010 - 07:25 AM

So far I have not been able to find this in FSX, once FSX starts searching for a parking spot it will scan all of them and return the best match. On a higher level though the scheduler does kick in. The agents that act as ATC Controllers are part of the 6Hz group. I haven't analyzed it in detail but I could very well be possible that if an agent has to find 7 parking spots and it will only get time to look up 4. But once it starts searching for a specific plane it will scan all of the parkings.

The scoring algorithm is rather complex, the details I have deciphered so far are in a Wiki article over at fsdevelopper: http://www.fsdevelop...dex.passignment

Daniel
  • 0
Daniel van Os
Disposition Software Development
KvK 08165245

#11 Burkhard

Burkhard

    Product Support

  • Moderators
  • 14,232 posts
  • LocationIn front of my computer

Posted 02 February 2010 - 08:59 AM

Very interesting reading. I have the impression though , that very large differences in radius overwrite the type, so if I have a Ramp_Mil_Cargo of 50m and a RAMP_GA of 18m and a Transall, I find it often on the GA and not on the Military parking.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


About simFlight - simflight.com - simflight.de - simflight.fr - simflight.nl - simflight.pt - simflight.es - simflight.it - simflight.jp - simrussia.com - simMarket