SITREP Thu 9 Sep 21
Hi all,
So far this week I have pursued the issue of HQ allocation in complex attacks. The first thing I discovered was an error that had crept in after we started basing senior HQs. In CCA's brigade level attack at the start of the Turorial, it bases the CCA HQ and strips out firebases and a few independent units. The remainder comprise the attack force group (attackFG). There is a function which takes this attackFG and determines how many subAttacks should be generated based on the available number of attack capable subordinate HQs. Trouble is now one of the three Bn HQs assigned to CCA is now the subject of the attackFG - as we have based the CCA HQ. SO it only finds two subordinate HQs and generates only two subAttacks. Well that was an easy one to fix but it shows how easy it is to trip up when you start making changes.
After I fixed that it should have assigned each of the three Bn HQs to a separate subAttack. But it chose to assign two HQs (51 Bn and 1.318th Bn) to one of the attacks, 35 Tk Bn to another and the third one didn't get a HQ, just five units. I painstakingly stepped through the allocation code and realised that the levelling code was assigning the 1.318th Bn HQ because most of its subordinate companies had been assigned to the first subAttack, which already had the 51st Bn HQ assigned.
This is a difficult one to solve. I've been considering different approaches. But what I have settled on is to assign the HQs in the PreAllocationPass that occurs before the normal passes. But then I face the issue of how to assign the HQs - ie to which of the attacks. I need to use the FUPs, rather than the objectives of each task, which are more or less at the same spot. But there is another issue to consider. What happens when you have a situation where the HQs may not be with the bulk of its units. This can occur if the force has just one attack and the HQs is back at the old reserveLoc, while the assault units are at the objective. We may end up with the HQ being assigned to the new FUP1 even though the bulk of its forces are close to FUP2.
So to address this, I have written some new code that determines the centre of mass (COM) for the force. Essentially, it processes each member of the force and works out the mean or average location. But then it culls any outliers - units/HQ that may be located at some distance from the meanLoc. It then recalc the COMLoc, so we end up with a location in the middle of the bulk of the force. Tomorrow I aim to use this code for the HQs during the PreAllocationPass. Hopefully, this will avoid having units swapping all over the place. Fingers crossed.