I have no idea how AI's are coded here but in another game They made something really simple. They defined a target point (Generally your CC) with a range of tiles, a peacetime (so that units doesn't attack to early) a tech level (This is because the Ais had all the buildings they needed at the beginning so they would recruit only a specific age units) agressiveness (I think this one decided how many units would seek to destroy you)