Exemplo n.º 1
0
        // Тестирование
        private void TestButton_Click(object sender, EventArgs e)
        {
            if (NET == null)
            {
                txtLogs.AppendText("Не создана сеть!\r\n");
                return;
            }

            double[] X = new double[NET.GetX];
            double[] Y;

            OutputVectorBox.Text = "";

            // Загружаем текущий входной файл

            for (int i = 0; i < NET.GetX; i++)
            {
                X[i] = Convert.ToDouble(InputVectorBox.Lines[i]);
            }

            NET.NetOUT(X, out Y);

            for (int i = 0; i < NET.GetY; i++)
            {
                OutputVectorBox.AppendText(string.Format("{0:F4}\r\n", Y[i]));
            }
        }
Exemplo n.º 2
0
        // Открыть файл для тестирования
        private void OpenTestFileButton_Click(object sender, EventArgs e)
        {
            if (NET == null)
            {
                txtLogs.AppendText("Не создана сеть!\r\n");
                return;
            }

            openFileDialog2.ShowDialog();

            String strFile = openFileDialog2.FileName;

            if (!File.Exists(strFile))
            {
                return;
            }

            double[] X = new double[NET.GetX];
            double[] Y;
            String[] currFile;

            InputVectorBox.Text  = "";
            OutputVectorBox.Text = "";

            // Загружаем текущий входной файл
            currFile             = File.ReadAllLines(strFile);
            InputVectorBox.Lines = currFile;
            txtLogs.AppendText("Загружен файл:\r\n" + Convert.ToString(strFile) + "\r\n");

            for (int i = 0; i < NET.GetX; i++)
            {
                X[i] = Convert.ToDouble(currFile[i]);
            }

            NET.NetOUT(X, out Y);

            for (int i = 0; i < NET.GetY; i++)
            {
                OutputVectorBox.AppendText(string.Format("{0:F4}\r\n", Y[i]));
            }
        }