Exemplo n.º 1
0
        public void BoostTest100Pct(int period)
        {
            int numCols = 1;

            double[] overallActivity = new double[numCols];
            double[] currentAtivity  = new double[numCols];

            double max = 0.0;

            for (int i = 0; i < period * 100; i++)
            {
                // Active in every cycle.
                currentAtivity[0] = 1;

                // Calculate boost result by boosting formel.
                overallActivity = SpatialPooler.CalcEventFrequency(overallActivity, currentAtivity, period);

                if (overallActivity[0] > max)
                {
                    max = overallActivity[0];
                }

                //Trace.WriteLine(Helpers.StringifyVector(overallActivity));
            }

            Assert.IsTrue(max <= 1.00);
            Assert.IsTrue(max >= 0.99);
        }