示例#1
0
文件: Solver.cs 项目: MOAAS/IART
        public ZhedStep zhedStep; //Zhed Step that created this node

        public Node(ZhedBoard board, Node parent, ZhedStep zhedStep, int value)
        {
            this.board    = board;
            this.parent   = parent;
            this.zhedStep = zhedStep;
            this.value    = value;
            this.height   = 0;

            while (parent != null)
            {
                this.height += 1;
                parent       = parent.parent;
            }
        }
示例#2
0
文件: Solver.cs 项目: MOAAS/IART
        public ZhedStep zhedStep; //Zhed Step that created this node

        public Node(ZhedBoard board, Node parent, ZhedStep zhedStep, int value, int cost)
        {
            this.board    = board;
            this.parent   = parent;
            this.zhedStep = zhedStep;
            this.value    = value;
            if (parent == null)
            {
                this.cost = cost;
            }
            else
            {
                this.cost = parent.cost + cost;
            }

            while (parent != null)
            {
                this.height += 1;
                parent       = parent.parent;
            }
        }