예제 #1
0
        /// <summary>
        /// Estimates path cost between a and b using selected heuristics function
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public float Heuristic(Vector3 a, Vector3 b)
        {
            switch (heuristic)
            {
            case HeuristicsFunction.euclidean:
                return(Heuristics.Euclidean(a, b));

            case HeuristicsFunction.manhattan:
                return(Heuristics.Manhattan(a, b));

            case HeuristicsFunction.chebyshev:
                return(Heuristics.Chebyshev(a, b));

            case HeuristicsFunction.octile:
                return(Heuristics.Octile(a, b));
            }
            return(0);
        }