This is incredibly useful, thank you!
Question: when choosing targets, does the AI consider a ranged unit's melee strength or ranged strength? For example, given the choice between attacking a warrior (20 melee strength unmodified) or an archer (15 melee/25 ranged strength unmodified), which unit does the AI choose? My hypothesis is that it's the archer since the 15 melee strength would be used for the defender's combat strength calculation.
Also, I'd be curious to know if the AI uses the same algorithm when fighting in the field vs. when fortified.