Cost calculation is based on:
- legs (and indirectly on aircraft)
- costs definitions
- cost formula.
The cost calculation algorithm takes into account "events" that are generated from selected legs grouped by aircraft the legs are assigned to.
Let's assume following example with three aircraft (Aircraft A1, Aircraft A2, and Aircraft A3), 12 flights (Flight F1, Flight F2, ...., Flight F12) within two following days (Day1 and Day2) in different time (0800h and 1600h are depicted with orange lines).
Each such flight can be transformed into special (internally defined in the system (hard coded)) events.
In the picture below, they are depicted as blue arrows. We can easily define, such events as TakeOff and Landing,
that are shown as an arrow at the beginning and at the end of a flight. This kind of event is a point in time.
Additionally, we can imagine that between Landing event and Take Off event that there is a Handling event that is a period in time. At its beginning and end and some distinct point in time that defines such an event as a point instead of a period. Note the horizontal blue arrows between flights.
We can also imagine the event that is flight itself (e.g. fuel burnt by a plane corresponds to the time of flight). In the picture below, note violet arrows above each flight.
Cost algorithm takes into account only this kind of event (the arrows shown in the pictures above). All events are grouped by an aircraft final cost is calculated based on configuration definitions and chosen definitions selected as an input for the algorithm.
Example 1
- from 0000 till 0800 (exclusive) Landing fee can be equal to 50EUR
- from 0800 (inclusive) till 1600 Landing fee can be equal to 100EUR
- from 1600 (inclusive) till 2400 (exclusive) Landing fee can be equal to 75EUR.
Example 2
- from 0800 till 1600 Landing fee can be equal to 50EUR
- from 1600 till 0800 Landing fee can be equal to 100EUR.
Period
If a definition is a period (i.e. Handling), the cost of such an event is calculated in parts to conform to the cost that can change in time.
Example
If Handling is different between 0800-1600 and 1600-0800, the cost will be calculated appropriately. In case of flights F9 and F10, the cost will be calculated differently:
- from landing till 1600 (exclusive)
- and from 1600 (inclusive) until TakeOff.
Same thing can happen when a day, month, year, or day of week changes.
Vehicle Type
Cost can be dependent on vehicle type.
Example
If aircraft A1 is Boeing 737 with Maximum Take Off Weight equal to X and aircraft A2 can be Airbus A380 with MTOW equal to Y, they can have different costs of landing/take off on the same airport and this different costs will be taken into account by the calculation algorithm.
Currency
Cost for each airport can be in different currency (i.e. MMX, STO in SEK, LHR in GBP, WAW in PLN). This can be defined in a cost definition and based on the exchange currency table. They will be recalculated into one result currency, e.g. EUR.
Inputs
Algorithm inputs are:
- definitions (that defines important cost base data) with:
- sets (that defines grouping/category for example per airport i.e. definition=Landing, Filter=CPH airport)
- set values (that defines validity periods (from-to), hours validity, frequency, additional filters (dependent on event "type")
- cost (i.e. from 01JAN17 till 31DEC17 from Monday till Friday from 0800 till 1600 price is 100 EUR).
- formula
- currency scenario (actually based static exchange rate tables)
- result currency.
Outputs
The algorithm output is a value in a selected result currency, grouped by selected currency scenarios.
Overview
Example
Let's assume following situation. There are four flights:
- 2 flights for aircraft A1 of type Boeing 737
- Flight F1 from MMX to WAW, STD=1200, STA=1315
- Flight F2 from WAW to FRA, STD=1700, STA=1900,
- 2 flights for aircraft A2 of type Airbus A380
- Flight F3 from MMX to WAW, STD=0600, STA=0710
- Flight F4 from WAW to FRA, STD=0900, STA=1100.
There are the following cost definitions:
- Name - TakeOff, per event
- MMX
- 0000-0000 (24h), 500 SEK for 737
- 0000-0000 (24h), 1000 SEK for A380.
- WAW
- 0800-1600, 100 PLN for 737
- 1600-0800, 200 PLN for 737
- 0800-1600, 150 PLN for A380
- 0800-1600, 300 PLN for A380
- 0000-0000 (24h), 50 PLN (for any other type).
- FRA
- 0800-1600, 100 EUR (for any type of aircraft)
- 1600-0800, 200 EUR (for any type of aircraft).
- MMX
- Name - Landing, per event
- WAW
- 0800-1600, 50 PLN for 737
- 1600-0800, 75 PLN for 737
- 0800-1600, 100 PLN for A380
- 0800-1600, 125 PLN for A380
- 0000-0000 (24h), 25 PLN (for any other type).
- FRA
- 0000-0000 (24h), 50 EUR (for any type of aircraft).
- 0000-0000 (24h), 50 EUR (for any type of aircraft).
- WAW
- Name - Handling, per minute
- MMX
- 0800-1600, 10 SEK
- 1600-0800, 20 SEK.
- WAW
- 0800-1600, 5 PLN
- 1600-0800, 10 PLN for 737
- 1600-0800, 15 PLN for A380.
- FRA
- 1000-2000, 10 EUR
- 2000-1000, 15 EUR.
- MMX
There are following formula definitions:
- Name: Formula 1, Expression: 2 * Landing + Handling + 3 * TakeOff.
There are following Exchange rate tables defined.
- Name: Expected, Rates:
- 1 EUR = 4 PLN
- 1 PLN = 0.5 SEK
- 1 EUR = 9 SEK.
User executes cost calculation algorithm with all above selected and result currency set to PLN, so:
- flights: F1, F2, F3, F4
- Definitions: TakeOff, Handling, Landing
- Formula: Formula 1
- Currency scenario: Expected
- Result currency: PLN.
Steps of the Algorithm
1. Transforms selected flights into events. The following events will be created:
- Event E1: TakeOff for flight F1 (MMX, 737, STD=1200)
- Event E2: Landing for flight F1 (WAW, 737, STA=1315)
- Event E3: TakeOff for flight F2 (WAW, 737, STD=1700)
- Event E4: Landing for flight F2 (FRA, 737, STA=1900)
- Event E5: Handling for aircraft A1 between flight F1 and F2 (WAW, 737, 1315-1700)
- Event E6: TakeOff for flight F3 (MMX, A380, STD=0600)
- Event E7: Landing for flight F3 (WAW, A380, STA=0710)
- Event E8: TakeOff for flight F4 (WAW, A380, STD=0900)
- Event E9: Landing for flight F5 (FRA, A380, STA=1100)
- Event E10: Handling for aircraft A2 between flight F3 and F4 (WAW, A380, 0710-0900).
2. Selected formula "2 * Landing + Handling + 3 * TakeOff" will be "tokenizen" (itemized) and calculation will be done for each definition "token".
- Processing will be done for Landing token - appropriate definition will be searched in the definitions given as input to the engine and because there is such a definition name equal to "Landing":
- All Landing events will be processed in this step (so events E2, E4, E7 and E9)
- For each of those events appropriate value will be calculated (E2 (WAW+737)=50 PLN, E4 (FRA+737)=50 EUR, E7 (WAW+A380)=100 PLN, E9 (FRA+A380)=50 EUR) so the cost for Landing is "150PLN + 100 EUR")
- This value (150PLN + 100 EUR) will be put instead of Landing definition token in the processed formula.
- Formula looks like this: "2 * (150PLN + 100EUR) + Handling + 3 * TakeOff".
- Processing of Handling token will be done. Appropriate definition will be searched in the definitions given as input to the engine and because there is such a definition name equal to "Handling":
- All Handling events will be processed in this step (so events E5 and E10)
- For each of those events appropriate value will be calculated (E5 - will be divided into parts 1315-1600 (165 minutes * 5 PLN=825PLN) and 1600-1700 (60 minutes * 10 PLN=600PLN) overall sum = 1425 PLN; E10 - will be divided into parts too: 0710-0800 (50 minutes * 15PLN=750PLN) and 0800-0900 (60 minutes * 5PLN=300PLN) overall sum = 1050PLN) so the cost for Handling is "2475 PLN"
- This value (2475PLN) will be put instead of Handling definition token in the processed formula.
- Formula looks like this: "2 * (150PLN + 100EUR) + (2475PLN) + 3 * TakeOff".
- Processing of TakeOff token will be done. The appropriate definition will be searched in the definitions given as input to the engine and because there is such a definition name equal to "TakeOff":
- All TakeOff events will be processed in this step (so events E1, E3, E6, E8)
- For each of those events appropriate value will be calculated (E1 (MMX+737)=500 SEK, E3 (WAW+737+1700)=200 PLN, E6 (MMX+A380)=1000 SEK, E8 (WAW+A380+0900)=300 PLN) so the cost for TakeOff is "1500 SEK + 500PLN"
- This value (1500 SEK + 500PLN) will be put instead of TakeOff definition token in the processed formula.
- Formula looks like this: "2 * (150PLN + 100EUR) + (2475PLN) + 3 * (1500 SEK + 500PLN)".
Additional information / Remarks:
If there will be a landing in MMX of an aircraft type Boeing 737, the cost of such Landing will be set to (MMX+737)=0 PLN. When there is no fee then result currency is taken into account and the cost taken into further calculations is equal to zero.
3. Now chosen currency scenarios are taken into account - because we have only 1 scenario (called "Expected") in this case then the calculation will look as follows:
- Based on the given exchange rates the currencies will be exchanged into result currency (PLN in this case)
- Formula will be transformed into "2 * (550PLN) + (2475PLN) + 3 * (1250PLN)"
- Formula will be calculated (evaluated) - so the result will be 7325 PLN for "Expected" currency scenario.