示例#1
0
        public MCTSNodeStoreContext(MCTSNodeStore store)
        {
            NodeStore    = store;
            PriorContext = curContext;

            // Update statics
            curStore    = store;
            curNodes    = store.Nodes.nodes;
            curChildren = store.Children.childIndices;
            curContext  = this;
        }
示例#2
0
        public void Dispose()
        {
            if (curStore == null)
            {
                throw new Exception("Internal error: MCTSNodeStoreContext improperly nested");
            }

            // Update statics
            if (PriorContext != null)
            {
                curStore    = PriorContext.NodeStore;
                curNodes    = PriorContext.NodeStore.Nodes.nodes;
                curChildren = PriorContext.NodeStore.Children.childIndices;
            }
            curContext = PriorContext;
        }