Please check
https://github.com/jamespetts/simutrans-pak128.britain/pull/99Or
https://github.com/vladki77/simutrans-pak128.britain/tree/electrostar-fixesI have changed the constraints so that BR-801RearMS must be the second last vehicle (just like 801MiddleFirst).
FrontMS may be immediately followed by RearMS, MiddleComposite and MiddleFirst to allow 4-car units. But we can easily enforce 5-car units by allowing only MiddlePower next to Front MS
Only RearMS, MiddleComposite and MiddleFirst may be at the second last position.
MiddlePower must be followed by RearMS, MiddleComposite, MiddleFirst or MiddleTrailer
MiddleTrailer must be followed by MiddlePower or MiddleComposite - i hoped for enforcing 2 power cars between MiddleTrailer and rear driving trailer, but the composite car allows immediate end. So we could as well allow MiddleFirst and RearMS next to MiddleTrailer. Should we?
DTS-MS-Mx-DTx (shortest possible, x is any class)
DTS-MS-MS-Mx-DTx (existing 5-car units)
DTS-MS-MS-MC-MF-DTx (non existent 6-car unit, high power)
DTS-MS-MS-TS-MC-DTx (non existent 6-car unit, lower power)
DTS-MS-MS-TS-M(sc)-Mx-DTx (probable formation of 807)
DTS-MS-MS-TS-MS-TS-MC-DTx (non existent 8-car unit)
DTS-MS-MS-TS-MS-TS-M(sc)-Mx-DTx (existing 9-car units)
I also thought about enforcing standard class rear (Rear-trolley) after RearMS, and first class rear (compact or full kitchen) after MiddleCOmposite and MiddleFirst.
So what dou you think?