Beispiel #1
0
        /// <summary>
        /// loads training data
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLoadTrainig_Click(object sender, EventArgs e)
        {
            var strFile = GPModelGlobals.GetFileFromOpenDialog();
            var data    = GPModelGlobals.LoadDataFromFile(strFile);

            LoadTrainingData(data, GPModelType.SR);
        }
Beispiel #2
0
        /// <summary>
        /// Fire event for loading test data
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLoadTesting_Click(object sender, EventArgs e)
        {
            var strFile = GPModelGlobals.GetFileFromOpenDialog();
            var data    = GPModelGlobals.LoadDataFromFile(strFile);

            if (_problemType == GPModelType.SR || _problemType == GPModelType.SRO)
            {
                LoadTestingData(data);
            }
            else if (_problemType == GPModelType.TS)
            {
                LoadSeriesData(data);
            }
            else if (_problemType == GPModelType.TSP)
            {
                LoadTrainingData(data, _problemType);
            }
            else if (_problemType == GPModelType.AP)
            {
                LoadTrainingData(data, _problemType);
            }
            else if (_problemType == GPModelType.TP)
            {
                LoadTrainingData(data, _problemType);
            }
            else
            {
                LoadTestingData(data);
            }
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            var strPath = GPModelGlobals.GetFileFromOpenDialog("Rich text files ", "*.rtf");

            if (strPath != null)
            {
                richTextBox1.LoadFile(strPath, RichTextBoxStreamType.RichText);
            }
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        bool OpenFromFile()
        {
            var strFile = GPModelGlobals.GetFileFromOpenDialog("GPdotNET file format", "*.gpa");

            if (string.IsNullOrEmpty(strFile))
            {
                return(false);
            }

            if (!CloseCurrentModel())
            {
                return(false);
            }

            bool retVal = Open(strFile);

            return(retVal);
        }
Beispiel #5
0
        //Import file
        private void button1_Click(object sender, EventArgs e)
        {
            var strFile = GPModelGlobals.GetFileFromOpenDialog("", "");

            if (strFile == null)
            {
                return;
            }
            var data = string.Join(Environment.NewLine, File.ReadAllLines(strFile).Where(l => !l.StartsWith("#") && !l.StartsWith("!")));

            originData    = data;
            textBox3.Text = data;
            ProcesData();

            if (!string.IsNullOrEmpty(data))
            {
                button2.Enabled = true;
            }
        }