- Flying to PHX, returning demand is 36k of cargo
- Added a flight to TUS with tiny bit of overlap in the catchment area results:
Demand from TUS: 0k -> +4k
Demand from PHX: 36k -> 22k = -14k
Round 1: Looking at the code and database, all cargo types:
#1) No flights at all:
KPHX-RCTP: Actual 13210 / Potential 35990
KTUS-RCTP: Actual 4150 / Potential 9030
#2) Flight only to PHX:
KPHX-RCTP: Actual 35990 / Potential 35990
KTUS-RCTP: Actual 850 / Potential 9030
(actual is never zero, not sure where you're getting that....)#3) Flights as of current MT game world to both PHX and TUS:
KPHX-RCTP: Actual 16670 / Potential 35990
KTUS-RCTP: Actual 3950 / Potential 9030
Does not seem logical but I am not yet sure "what it should be", before I eliminate some other things and do more testing.
Round 2: On both TPE and USA there were other airports involved, but no flights between them. Eliminated all other airports apart RCTP, KTUS, KPHX and after that:
- RCTP catches 4 areas with 100% of demand drawn from them.
- KPHX catches 8 areas, of which 7 are 100% and 1 area (#11447) is shared PHX-56 / TUS-44%.
- KTUS catches 4 areas, of which 3 are 100% to this airport.
After that the figures are:
#1) No flights at all:
KPHX-RCTP: Actual 34950 / Potential 35570
KTUS-RCTP: Actual 8160 / Potential 8920
=> These are logical (no other airports in area, and one overlapping area is shared).#2) Flight only to PHX:
KPHX-RCTP: Actual 35570 / Potential 35570
KTUS-RCTP: Actual 830 / Potential 8920
=> This too works as intended.#3) Flights as of current MT game world to both PHX and TUS:
KPHX-RCTP: Actual 22130 / Potential 35570
KTUS-RCTP: Actual 3950 / Potential 8920
=> Beep! Total demand 26080, while it should be ~44kRound 3: If we eliminate totally the one area (#11447) that is overlapping between PHX and TUS, and no other airports are involved, the results are as expected:
#3) Flights as of current MT game world to both PHX and TUS:
KPHX-RCTP: Actual 34160 / Potential 34160
KTUS-RCTP: Actual 7690 / Potential 7690
=> OK! The airports don't overlap so demand should be full to potential at both.Round 4: If we swap the situation from previous and we have only one departing area (that #11447) of which PHX and TUS share in 56/44% ratio (and the 3 arriving areas RCTP has), we get:
#1) No flights at all:
KPHX-RCTP: Actual 1220 / Potential 2170
KTUS-RCTP: Actual 940 / Potential 2110
=> OK. Total demand 2160.#2) Flight only to PHX:
KPHX-RCTP: Actual 2170 / Potential 2170
KTUS-RCTP: Actual 220 / Potential 2110
=> This too works as intended.#3) Flights as of current MT game world to both PHX and TUS:
KPHX-RCTP: Actual 1310 / Potential 2170
KTUS-RCTP: Actual 850 / Potential 2110
=> Total demand is 2160, works fine. => As a minor detail; potential for both airports should be the same? Maybe; have to check => The 60kg difference in potential is caused by different distance from PHX and TUS to destination. The distance from dep to arr airport is one factor, and airport-to-airport dist. is used instead of area-to-area distance due to speed (area-to-area calculation for this would be too slow). So this is correct but room for minor improvement here if performance permits in the future.
Round 5: Situation of areas returned to "round 2" where issue was present, with one overlapping area, but catchment of the one overlapping area is changed to 50%/50% between the airports for easier calculation. All possible internal scaling factors and all game world specific adjustment settings are removed and calculation should be "pure" from any adjustments. (figures are low, but that's not the point)
#1) No flights at all:
KPHX-RCTP: Actual 13330 / Potential 13600
KTUS-RCTP: Actual 3290 / Potential 3550
=> OK.#2) Flight only to PHX:
KPHX-RCTP: Actual 13600 / Potential 13600
KTUS-RCTP: Actual 360 / Potential 3550
=> OK.#3) Flights as of current MT game world to both PHX and TUS:
KPHX-RCTP: Actual 8400 / Potential 13600
KTUS-RCTP: Actual 1580 / Potential 3550
=> Still incorrect, total demand is 10k (should be ~14-15k) => Any of custom settings or factors are not the cause.
Round 6: Figuring out what the figures SHOULD be. Situation and settings as on round 5.
#A) Only KPHX-RCTP, all other data eliminated. PHX gets 100% of all the areas it overlaps and area #11447 removed.
KPHX-RCTP: Potential 13060
#B) Only KTUS-RCTP, all other data eliminated. TUS gets 100% of all the areas it overlaps and area #11447 removed.
KTUS-RCTP: Potential 3020
#C) Calculating only the area #11447 to RCTP:
#11447-RCTP: Potential 570
Totals:
KPHX-RCTP: Potential 13060 + Potential 570 = 13630
KTUS-RCTP: Potential 3020 + Potential 570 = 3590
=> Comparing to 'round 5' the figures for potential match 13600 vs 13630 and 3550 vs 3590. Minor differences (+/-50kg) due to the way some score values are counted when number of results increase.If the area #11447 is split 50/50 between the two airports, then the Actual demand should be:
KPHX-RCTP: Potential 13060 + 50%-Potential 570/2 = Actual 13345 (rounded to 13350?) / Potential 13630
KTUS-RCTP: Potential 3020 + 50%-Potential 570/2 = Actual 3305 (rounded to 3300?) / Potential 3590
=> Total expected actual demand should be 16650.In the case there are no flights, the calculation is OK. We had 13330 and 3290, and here we calculated manually 13350 and 3300.
(to be continued)