I agree about the competency if the AI since I am quite familiar with programing. That said, my reference to them making a beeline to the ones closest to them was not referring to just 3 or four squares away, but quite a distance (as some of the villages were eight or nine). Although it is true that it has no
true recall of the past, the algorithms in current programing do a good job of allowing a fairly good approximation of recollection. The disadvantages the AI suffers can be balanced and saying it is stupid is a bit a simplified IMO. Programing is still not much different than a complex form of "if[ ] then goto[ ]". For example, You build a mental pathway based on decisions made by the AI Civ's and make your choices based on those. The AI is able to do the same but in a less complex way. So more like "If[ ]and[ ]and[ ]... then goto[ ]", in a complex flow chart that allows changes based on past decision made by you and it. It is not so dissimilar to the thought processes we make throughout our day. The difference is it is less likely to make a mistake by miss click, or forgetting the path you originally intended to take. Fortunately, we have save points for those instances.
The process is quite a bit more complex then my explanation, but I am hoping to put it in words that those who are not familiar with programing will understand.