change the way cargo space is allocated - make it intuitive

Started by sanabas, April 13, 2020, 09:34:49 PM

sanabas

I know I've posted this in discord and other threads, but I don't think it's appeared in the bug or feature request forums. So here it is.

*edit* and as I typed out this long post, I discover things have changed from what they were, I'm fairly sure. It's now better, east & west now have an identical split. Unless I just haven't looked hard enough and can't find one of the really out of whack routes. But can still get better. Can probably skip the first section and just read the end bit, as I was thinking while typing, and came up with a better idea...*/edit*

My research says that
1m^3 = 100kg CL = 250kg CS = 500kg CH.

The current allocation algorithm seems to start with CL, then CS, then CH.

e.g. a 733 combi has 13.1m^3, and enough spare payload to carry a full hold of CS.
Lets say I have a route with 2000kg of cargo demand, 600CL, 1400 CS. Intuitively, that means I want a 30/70 split when creating the route.
Split it 30/70, and the algorithm says 13.1*0.3*100 = 393kg CL, 13.1*0.7*250 = 2292.5kg CS - I leave 200+kg of CL unserved, I oversupply CS by 900kg.
If I want the actual supply to match the 30/70 split of the demand, then I need to use some maths skills, figure out the demand volume is 6m^3/ and the CS demand is 5.6m^3, and make my actual assigned split be 50/50 (which gives 655/1638) or 55/45 (721/1474).

On short routes, enough trial and error, or knowing the density of each type of cargo, allows you to work around this, and get the supply you want.

However, when flying beyond the combis max payload range, something that happens with most planes, this breaks down. Go far enough beyond max range, to where the hold has enough volume to carry a full load of CL only, and now the split is purely weight based. So if our hypothetical route is just short enough for max payload flying east, but ESAD is 300NM longer flying west and limits us to 2000kg of cargo, we have a choice. We can go 30/70, which gives 390/2290 east and 600/1400 west. Or we can go 50/50, which gives 650/1640 east and 1000/1000 west.

To pick an actual example, a DC8-54CF with 62 seats, 104.15m^3 capacity. Max cargo payload is 35250kg.
RJTT-KSFO via PCDB.
My assigned split is 30/40/30.
Eastbound, 104.15*0.3*100 = 3120, 104.15*0.4*250 = 10,415, 104.15*0.4*500 = 20,830.
Actual cargo I supply on the route is 3130/10,420/15,630, a 10.7/35.7/53.6 split
So seems pretty clear that I'm limited to 29,180 by being just over the range at MTOW, and it's started by calculating CL volume, then CS volume, then all remaining volume/weight (whichever is lower) is given to CH.

Westbound is longer because of the wind. Haven't tried to reverse engineer it, but I supply 2,500/8,310/12,470, which is also a 10.7/35.7/53.6. So at this point I made the edit at the top of post, looks like an unannounced change has happened, which is good.

However, there's still the issue of it giving 10.7/35.7/53.6 split to supply, when intuitively, we'd expect 30/40/30, and we'd assign 30/40/30 if that's how the demand graph was split...

My proposed solution is to start at the other end, by allocating CH as a % of available weight.
So in this case, flying east, the max weight is 29,180. 29,180*0.3 = 8,754, round to 8,750. 29,180*0.4 = 11,672 round to 11,670.
8,750 CH = 17.5m^3, 11,670 CS = 46.68 m^3, so we have 39.97m^3 = 3,997kg left for CL, and we have 8,750kg left on the payload. We take the lower of the two numbers, we supply 4,000kg of CL.

Flying west, the max weight is 23,280kg. Same thing, 23,280*0.3= 6,980kg CH = 13.96m^3, 23,280*0.4 = 9,310 CS = 37.24m^3, 6,990kg and 52.95m^3, so we supply 5,290kg of CL

The numbers we get will be slightly counter-intuitive, as they'll result in slightly less CL than expected, as well as slightly less cargo payload than the maximum. But as CL gives the least revenue and is typically has the most supplied flights, this isn't such a big deal, and can be fixed quickly on individual flights with a little trial and error. More importantly, it lets us assign splits intuitively. There's 6,000kg demand for CH, I'm limited to 22,000kg, therefore I want 30% = 6,600kg CH supplied. There's 8,000 demand for CS, I want 35 or 40% for 7,700 or 8,800. Whatever's left goes to CL. I don't see 29,000kg limit on cargo, 8,200kg demand, decide I want 30% CH for 8,700kg and find out once I'm flying the route that I actually have over 50%/15,000kg supplied.





In fact, there is an even simpler way to do it mathematically, one that gives 100% intuitive results. 1000kg CL = 10m^3, 1000kg CS = 4m^3, 1000kg CH = 2m^3

Let's say I split 10/50/40. 0.10*10+0.50*4+0.40*2 = 2.9.
Therefore for every 2.9m^3 of volume, I can carry 1000kg of cargo in my desired split of 100/500/400kg.

Let's say I'm at longer range on a DC8-54 freighter, can carry 30,000kg and have 201.4m^3 of space. 30,000/1000 = 30, 201.4/2.9 = 69.45. The weight number is smaller, therefore we're weight limited, and we have 30 lots of 1000kg. 30*100 = 3,000, 30*500 = 15,000, 30*400 = 12,000, exactly the 10/50/40 we asked for, and carrying our full payload.

Let's say we want a 25/45/30 split, but now we're on a -54CF at short range, so we can carry 35,250kg, 104.15m^3. Same calculation as before for the split, 0.25*10 + 0.45*4 + 0.3*2 = 4.9. 35,250/1000 = 35.25. 104.15/4.9 = 21.26. Volume number is lower, so we're volume limited.
21.26*250 = 5,315, 21.26*450 = 9,567, 21.26*300 = 6,378, again we have perfect 10/50/40 split and now a full hold.

Let's go back to our 733 combi, we're on a longer route and somewhat limited, can carry 2400kg. We want a 30/70 split.
0.3*10+0.7*4 = 5.8, so it takes 5.8m^3 of space to carry 1000kg. 2,400/1,000 = 2.4, 13.1/5.8 = 2.26. So despite the added range, we're still volume limited.
2.26*300 = 678, 2.26*700 = 1,582, so we get the 30/70 split we want.

This method will work for any plane on any route. We know the weight limit of the cargo payload, we know the volume available to cargo, we've assigned split x/y/z for CL/CS/CH. 0.01*x + 0.004*y + 0.002*z = v, the volume in m^3 required for 100kg of cargo. weight limit/100 = a, and volume limit/v = b, the lower of a & b determines whether we're limited by weight or volume. And we can carry ax/ay/az or bx/by/bz, which is intuitively split in the same ratio we assigned at route planning.