You know the problem with making this open source is you get idiots like me who think they can fix something .. so here I go
Submitted a PR which looks like it alleviates most of the problems on my test machine but I make no guarantees. But here is what I found so far (please take it with a grain of salt)
It appears most of the issues come from a flight preference calculation that involves passengers and lounges. First of all when the demand for flights is generated new classes of passengers have been added, which in theory should mean increased demand. But these new passengers who are Business/First really want lounges .. some want level 1 .. some want level 2 .. some want level 3 .. and of course there are the ones who have no preference. These preference calculations work by adjusting the price of the offered routes up or down depending on certain factors. These "perceived" prices are then used to see if that passenger travels and on which route.
I saw two issues with preference calculations
#1. B/F passengers with a lounge preference. The code made the perceive price lower if and ONLY if the airline had a lounge of required level on both sides (rare except for hub-to-hub) which is kinda silly. If you only had a lounge on one side the perceived price went up by a huge amount (though less than if you had no lounges). As the vast majority are and should be one-sided the code shouldn't penalize you for only having a lounge on one side. But if you do have both then extra benefit. I do believe it meant that this extra demand wasn't ever really being used (except in rare both side lounge cases .. looking at you ALEX)
#2 B/F passengers with no lounge preference. I noticed my demand was skewed (close to 0) on routes with no lounge (though a rival airline had one) or one side had a better lounge than I did (Blames ALEX again for no reason). I believe the calculations for the perceived price which saw one side having a lounge made my normal B/F fares too high in comparison. So I a reduction in impact for B/F passengers who have little preference is in order.
I'm sure the actual values will probably need to be modified but that's my take from poking around the code and my PR is up.
Thought this would be interesting to talk about .. if only we had in game chat
Many thanks for looking into the problem for me !!!
Some quick thoughts:
For #1 - yes it was intentional. My thought is that i want to introduce some extra passengers of the existing ones, but these passengers are super picky and will only take flights if there are lounges along the way. My way to avoid affecting existing B/F class demand is to make both demand * 2.5 but when it does the random selection on the preference it has 2/5 chance to pick the only that has lounge requirement of 0.
So the amount of B/F passengers that has no lounge preference (no penalty of having no lounge - just like before the change) will be roughly the same as before. And the rest of the B/F passengers will be those that has lounge preference (penalty if no lounge on either side)
For #2 - it is true that if other airlines have lounge on either end, your cost will be relatively higher. However, once ur competitor's flight is 100% full, your less attractive route will still be considered. So my thought is that unless your competitor build lounge and drastically increase the supply of B/F class seats, otherwise your airline will still get B/F class filled later on.
Another thought i had this morning is that the Lounge bonus has been too heavy and some passengers decided to take crazy zigzag routes that violates this check
https://github.com/patsonluk/airline/blob/master/airline-data/src/main/scala/com/patson/PassengerSimulation.scala#L219The problem with violating this check is that the logic assume no better route can be found (the logic is - if this best route is not good enough, then there will not be any better route in next run), so it totally drops that from the next round of simulation. Therefore if alot of B/F passengers picked a crazy route due to lounge bonus, they would be rejected by that check and those B/F passengers would be sucked into the black hole and never come back again
I see that a bit unlikely though, cause the disappearance of passengers seem too severe and i dun really think this explains it
hmmmmmmm.....maybe i can turn this into a difference game....