Esempio n. 1
0
        public void Propigate()
        {
            if (net == null)
            {
                throw new Exception("Reader is empty");
            }
            Assert.AreEqual(100, net.Count);

            List <double> inputs = new List <double>(),
                          goals  = new List <double>();

            inputs.Add(0.5);
            inputs.Add(0.5);
            goals.Add(0.5);
            goals.Add(0.5);
            goals.Add(0.5);
            goals.Add(0.5);

            net.Propigate(inputs, goals);
            List <double> error = net.getError();

            net.Sort();
            double expected = net.getError().Last();

            for (int i = 0; i < 100; i++)
            {
                net.Mutate(0.5);
                net.Propigate(inputs, goals);
                net.Sort();

                double testing = net.Last().getError();

                Assert.AreNotEqual(0, testing);
            }
            double actual = net.Last().getError();

            Assert.IsTrue(expected > actual);
        }