Maximum Flight Profit

READ THIS FORUM FIRST! Here are the rules and important information for you.

Moderator: FSAirlines Staff

Post Reply
User avatar
joefremont
FSAirlines Developer
Posts: 3694
Joined: Tue May 16, 2006 5:46 am
Location: KSFO

Maximum Flight Profit

Post by joefremont » Mon Mar 29, 2021 12:37 am

Hi Flyers.

I was recently trying to debug a couple flights that failed to record there packages and revenue. I tracked down the problem to this. The flights in question were done by a new airline that had just gotten a 747F and had loaded it full of packages for a 3000 mn flight. Before the multiplier the flights had a profit of about 3 million but after the multiplier was applied the profit was about 3 billion, at the risk of being overly technical, this caused a bug in the system because the column in the database where we store the amount of a financial single transaction is a 32 bit integer which has a maximum value of plus or minus 2.147 billion. This broke the function that calculated and recorded the revenue for a flight.

On reflecting on this, it's an absurd situation, no single flight should be able to generate that much revenue. The multiplier was really intended so airlines could start small (with smaller aircraft) and then build up, not jump from an under 500m to an over 3b airline in a single flight.

So because of this experience we now have a new rule, which will forever be known as "Mark's rule" after the pilot who helped discover it and it is this:

No single flight may generate 500 million V$ or more in revenue. If it does the multiplier applied to it will be reduced through its normal steps until the profit is less than 500 million v$.


I am going to make this retroactive to the beginning of the year, if for no other reason it helps be test the code, but won't go beyond that. There are only five flights that this would apply to.

The problem that caused this in the first place is the same as what is going to cause "Time to end in 2038", if you want a scare that is going to keep you up at night, go and Google search that.
Image
I've sworn an oath of solitude until the pestilence is purged from the lands.

User avatar
joefremont
FSAirlines Developer
Posts: 3694
Joined: Tue May 16, 2006 5:46 am
Location: KSFO

Re: Maximum Flight Profit

Post by joefremont » Mon Jun 07, 2021 5:11 pm

Update, as of June 1, the limit on revenue per flight has been dropped from 1 Billion to 500 million. I will not go back and recalculate any flights but if you ask for a flight to be reviewed and a recalculation is done it will be done at the new limit.
Image
I've sworn an oath of solitude until the pestilence is purged from the lands.

Post Reply