AIXI.CTWContextTree.update_tree C# (CSharp) Метод

update_tree() публичный Метод

public update_tree ( int symbolList ) : void
symbolList int
Результат void
        public void update_tree(int[] symbolList)
        {
            foreach (int symbol in symbolList) {
                if (this.History.Count >= this.Depth) {
                    this.update_context();
                    for (int i = this.Depth-1; i >=0; i--)
                    {
                        CTWContextTreeNode contextNode = this.Context[i];
                        contextNode.Update(symbol);
                    }
                }
                this.update_tree_history(symbol);
            }
        }

Usage Example

Пример #1
0
        public void TestMethod1()
        {
            //here we make instances of CTWContextTreeFast and CTWContextTree and test if they behave in same way
            var ctf = new CTWContextTreeFast(9);
            var ct = new CTWContextTree(9);

            int[] input = { 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1 };
            ct.update_tree(input);
            ctf.update_tree(input);
            ct.revert_tree(4);
            ctf.revert_tree(4);
            int[] input2 = { 0, 0, 1 };
            ct.update_tree(input2);
            ctf.update_tree(input2);

            Assert.IsTrue(ctf.compare(ct));
        }