calculate AI vector only once at the beginning of local problem
clean up local problem