Ejemplo n.º 1
0
        public KopsMultysession(string path)
        {
            this.path = path;

            StreamReader f = new StreamReader(path);

            List <string> file = new List <string>();

            while (!f.EndOfStream)
            {
                file.Add(f.ReadLine().Split('*')[0]);
            }

            f.Close();

            int sessions = int.Parse(file[0]);

            tournaments = new List <KopsTournament>();

            for (int i = 0; i < sessions; i++)
            {
                tournaments.Add(new KopsTournament(String.Format(@"{0}\{1}.INF",
                                                                 Path.GetDirectoryName(path),
                                                                 file[i + 1]), new KopsReader()));
            }

            for (int i = 1; i < sessions + 1; i++)
            {
                if (file[sessions + 1].Trim().Equals(file[i]))
                {
                    baseTournament = tournaments[i - 1];
                }
            }

            counting = int.Parse(file[sessions + 2]);

            weights = new List <double>();

            for (int i = sessions + 3; i < sessions * 2 + 3; i++)
            {
                weights.Add(KopsHelper.GetDoubleFromString(file[i]));
            }
        }
Ejemplo n.º 2
0
        private void ReadSessionResults()
        {
            try {
                TextReader f = readerFactory.GetTextReader(path, "SES");

                String type = f.ReadLine();
                if (type.Equals("MAXY"))
                {
                    sessionMax = int.Parse(f.ReadLine().Split('\t')[0]);
                    scoringMethod.SetMax(sessionMax);
                }
                else
                {
                    f.ReadLine();
                    sessionMax = 100;
                }
                sessionResults = new Dictionary <int, KeyValuePair <double, double> >();

                f.ReadLine();

                String s;
                while ((s = f.ReadLine()) != null)
                {
                    if (s.Split('\t').Length > 2)
                    {
                        sessionResults.Add(int.Parse(s.Split('\t')[0]),
                                           new KeyValuePair <double, double>(
                                               KopsHelper.GetDoubleFromString(s.Split('\t')[1]),
                                               KopsHelper.GetDoubleFromString(s.Split('\t')[2])));
                    }
                }

                f.Close();
            } catch (Exception) {
                System.Windows.Forms.MessageBox.Show("No Session Results.");
            }
        }