public LStarAlgorithmHelper()
 {
     HeursticInfo = new LStarHeurstic()
     {
         HeuristicFunc = HeuristicFunction.Euclidean
     };
 }
Example #2
0
        /// <summary>
        /// 构造函数 - 将参数传入节点内进行初始化
        /// </summary>
        /// <param name="mFPoint3">点</param>
        /// <param name="mParentNode">父节点</param>
        public Node(FPoint3 mFPoint3, Node mParentNode, LStarHeurstic mHeurstic = null)
        {
            ///mHeurstic不要写成Static,否则没办法多线程并行化处理~
            ///函数式编程的IDEA吧。
            ///
            NodeLocation = new FPoint3(mFPoint3.X, mFPoint3.Y, mFPoint3.Z);
            ParentNode   = mParentNode;

            if (mHeurstic != null)
            {
                if (mParentNode == null)
                {
                    GValue = 0;
                    HValue = mHeurstic.HeuristicFunc(mHeurstic.StartNode, mHeurstic.TargetNode);
                }
                else
                {
                    ///刷出来俩宝贝。。。。。
                    GValue = mHeurstic.GValueFunction(this);
                    HValue = mHeurstic.HValueFunction(this);
                }
            }
            else
            {
                GValue = 0;
                HValue = double.MaxValue;
            }
        }