Exemplo n.º 1
0
    private void SearchInit(string job)
    {
        Dictionary <string, string> @params = Json.fromJson(job);
        string windowStr = @params["window"];
        string limitStr  = @params["limit"];
        string deepStr   = @params["deep"];
        string debugStr  = @params["debug"];
        string boardStr  = @params["board"];

        jobId = @params["jobid"];

        debug = (debugStr == "true");

        board.Init(boardStr);
        if (debug)
        {
            //board->PrintBoard();
        }

        if (windowStr != "")
        {
            window = new Score(windowStr);
        }
        else
        {
            window.clear();
        }
        windowNega = window.Negate();

        deep = uint.Parse(deepStr);

        if (limitStr != "")
        {
            limit = new Score(limitStr);
        }
        else
        {
            limit.clear();
        }

        nodeStack.clear();
        // ルート
        nodeStack.push_back(new Node());
        // 自分
        MoveList moveList = new MoveList();

        board.GetMoveList(moveList);
        nodeStack.push_back(moveList);
    }
Exemplo n.º 2
0
        /**
         * Query the tree for a reverse index.
         */
        public int query(BinaryHierarchicalNode i_node, LongDescripter768 feature)
        {
            this._num_of_result = 0;
            this.mlist.reset();
            NodeStack nodes = this._node_stack;

            nodes.clear();
            if (i_node.is_leaf)
            {
                this.append(i_node);
            }
            else
            {
                this.query(this.mlist, nodes, i_node, feature);
            }
            return((int)this._num_of_result);
        }