improve efficiency by moving AI vector calculation to the beginning of local problem.
fix equation 3.62.