SITREP Tuesday 11 Aug 2020.
It's been intense this last week. I'm on my second round of autotesting and fixing since I last posted. The testing highlighted a false assumption of mine that there would only ever be one self assigned plan within a force's opPlan and that this would have the force as its subject. Alas, I forgot that we create self assigned plans for subordinates if they cannot be allocated across available objectives for whatever reason - usually unreachable or out of fuel. So I had to rework my new partial replanning code. I have refactored the code to put all the core level functionality inside the scheduling code and call this from the various events which trigger a partial replan.
The good thing about this though is that it now nuances the response to abandon mission, reinforcement, recovery and completion events. In general if the abandoned plan is significant or there are self assigned missions it will opt to do a multiplan spill. After it exempts plans we don't want to touch, it allocate forces across the remaining "replans" and sends orders. The exempt plans will not be affected.
If it doesn't spill and the force is significant, it will do a multiplan top up. This similarly exempts plans but instead of reallocating all forces for the replans it instead pre-allocates the existing allocation to these and only adds forces from the abandoned plan or arriving reinforcements. These get to top up the replans. The additional force is thus spread across one or more replans.
If the force is insignificant, it does a single plan top up. It simply sorts the replans by suitability and then selects one. It's random to a degree but is biased towards the highest suitable plan.
I have written the code for abandon mission event and it compiles. Tomorow I'll do the other events and test the game.