So far as I understand, it is worked out at the individual soldier level - not group level. Combatants pair off (no more than two soldiers can attack an enemy soldier at any one time) and the outcome of every attack computed at each time interval. Someone once told me how long the time interval was, I forget exactly the answer, but it was very short (eg a second).