internal double Train()
        {
            lock (tempRoute)
            {
                if (tempRoute.Count > 0)
                {
                    route.AddRange(tempRoute);

                    int length = (route.Count - NEEDED_COUNT) / 2;
                    if (length > inputLength)
                    {
                        length = inputLength;
                    }

                    if ((length > 0) && ((mlp == null) || (mlp.inputLength != length)))
                    {
                        mlp = new PredictorMLP(2, length);
                    }

                    if (route.Count > maxLength)
                    {
                        route.RemoveRange(0, route.Count - maxLength);
                    }
                    tempRoute.Clear();
                }
            }
            double[] input = MakeInput(route);
            if ((input != null) && (mlp != null))
            {
                return(mlp.Train(input));
            }
            else
            {
                return(0);
            }
        }
        internal double Train()
        {
            lock (tempRoute)
            {
                if (tempRoute.Count > 0)
                {
                    route.AddRange(tempRoute);

                    int length = (route.Count - NEEDED_COUNT) / 2;
                    if (length > inputLength) length = inputLength;

                    if ((length > 0) && ((mlp == null) || (mlp.inputLength != length))) mlp = new PredictorMLP(2, length);
                    
                    if (route.Count > maxLength) route.RemoveRange(0, route.Count - maxLength);
                    tempRoute.Clear();
                }
            }
            double[] input = MakeInput(route);
            if ((input != null) && (mlp != null)) return mlp.Train(input);
            else return 0;
        }