How does the engine compute which regions to retreat or withdrawl into?
I'm seeing alot of odd choices in play, units often choosing to retreat in a direction that effectively puts them behind enemy lines, or has the effect of seemingly retreating through the attack route.
For example, In the Austerlitz scenario, I had Spranger guarding Ausburg. During the turn, Davout moved down from Ansbach to Ausburg. Spranger avoided engaging and withdrew....to Ansbach! (crossing a river in the process!) looking at the map, almost ANY other region would've been a better, more logical choice-west to friendly forces, south to friendly forces, east to avoid entrapment..North is not only an odd choice for strategic merit, but it seems stranger in that the retreat effectively goes through the enemy front.
I've seen this in other scenarios as well..Hohenlohe-Ingelfingen tends to retreat south while moving north and being attacked from the south in Jena, and so on..
So, just wondering, what pulls a withdrawing unit into a given region?
Is it just random?