Keeping track of changes: the performance of ant colonies in dynamic environments