Learning coordinated motions in a competition for food between ant colonies