Esempio n. 1
0
        public void testLeastUsedCell()
        {
            TemporalMemory tm = new TemporalMemory();
            Connections    cn = new Connections();
            Parameters     p  = GetDefaultParameters(null, Parameters.KEY.COLUMN_DIMENSIONS, new int[] { 2 });

            p = GetDefaultParameters(p, Parameters.KEY.CELLS_PER_COLUMN, 2);
            p.Apply(cn);
            TemporalMemory.Init(cn);

            DistalDendrite dd = cn.CreateSegment(cn.GetCell(0));

            cn.CreateSynapse(dd, cn.GetCell(3), 0.3);

            for (int i = 0; i < 100; i++)
            {
                Assert.AreEqual(1, tm.LeastUsedCell(cn, cn.GetColumn(0).GetCells(), cn.GetRandom()).GetIndex());
            }
        }