Example #1
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "|*.txt";
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                Data[] dataSet;
                var    linesFromFile = new List <string>();
                using (StreamReader sr = new StreamReader(openFileDialog.FileName))
                {
                    while (!sr.EndOfStream)
                    {
                        linesFromFile.Add(sr.ReadLine());
                    }
                }
                dataSet = Data.CreateDataSample(linesFromFile);
                tbResultPenalty.Text       = Penalty.ToString();
                tbResultAmountOfTrees.Text = AmountOfTreesInForest.ToString();
                tbResultTreeError.Text     = Math.Round(Tree.TestDataSet(dataSet), 4).ToString();
                if (Forest != null)
                {
                    tbResultForestError.Text = Math.Round(Forest.TestDataSet(dataSet), 4).ToString();
                }
                FillDataGridTest(dataSet);
            }
        }
Example #2
0
 public string DisplayString()
 {
     return("{0} ({1} {2} /{3} {4})".Formatted(
                Name,
                Penalty.ToString(),
                PenaltyStatistic,
                Bonus.ToString(),
                BonusStatistic
                ));
 }
Example #3
0
 public override string ToString()
 {
     return(((int)Stage).ToString() + "S" + Firepower.ToString("X") + DayCost.ToString() + Reward.ToString("X") + Penalty.ToString());
 }