VatConnect / FSX

VatConnect
Other
1 stars 1 forks source link

Implement model matcher #3

Open cfcoon opened 7 years ago

cfcoon commented 7 years ago

The problem is a lot of aircraft don't specify ICAO type or airline necessarily (ICAO type should be in atc_type field in config files but it's not always correct or filled in). Descriptions rarely include it either, or not as ICAO (like "B737-800" or "Delta Boeing 737-800" instead of "B738"). Sooooo... we first need to scan the installed aircraft and figure out what ICAO type it is (required field) and what ICAO airline it appears to be (optional, only if airline ICAO or name is listed in description). Then we build a "Matching List" which for every possible ICAO type (at least majority used on VATSIM) it either points to the installed aircraft of that ICAO type, or points to another installed aircraft with the closest physical match to that ICAO type.

Basic algorithm:

Note: "closest physical match" is fuzzy, weighted score. For small prop aircraft probably high/low wing is highest, size second, #engines third. For jets, size probably first then wing/tail engine mount, then # engines. A DC-10 should match to an installed 747, not an installed 727 (despite same # engines and tail mount); An ATR-72 should match to an installed MD80 over a King Air, but should match to an installed DC-3 over an MD80. Whole thing probably doesn't matter much since user can override odd pairings.