示例#1
0
        void testNNLineFollower()
        {
            NeuralNetworkLineFollower net = new NeuralNetworkLineFollower();

            Console.WriteLine();
            net.learn();
            Console.WriteLine();

            // sensors (touch, light|color, ultrasonic) and bias 1
            // light sensor (0|1)
            double[] inputs = { 0, 1 };
            // motors B, C on/off (0|1)
            double[] outputs = { 1, 0 };

            net.test(inputs, outputs);
            // inputs: light 0-2, 3-8, 9-100
            // inputs: current position/status => light?
            // desired: r1 (down), r2(pick), r3(up), r4(down), r5(drop)
            // outputs: direction, speed, degree
            //			net.test (inputs, desired);

            inputs  = new double[] { 1, 1 };
            outputs = new double[] { 0, 1 };

            net.test(inputs, outputs);
        }
示例#2
0
文件: ev3.cs 项目: dpiquee/EV3
        void testNNLineFollower()
        {
            NeuralNetworkLineFollower net = new NeuralNetworkLineFollower ();
            Console.WriteLine ();
            net.learn ();
            Console.WriteLine ();

            // sensors (touch, light|color, ultrasonic) and bias 1
            // light sensor (0|1)
            double[] inputs = {0, 1};
            // motors B, C on/off (0|1)
            double[] outputs = {1, 0};

            net.test (inputs, outputs);
            // inputs: light 0-2, 3-8, 9-100
            // inputs: current position/status => light?
            // desired: r1 (down), r2(pick), r3(up), r4(down), r5(drop)
            // outputs: direction, speed, degree
            //			net.test (inputs, desired);

            inputs = new double[]{1, 1};
            outputs = new double[] {0, 1};

            net.test (inputs, outputs);
        }