Example #1
0
        /// <summary>
        /// LoadFromFile loads a statistics collection from a file.
        /// </summary>
        /// <param name="filename">The fully qualified filename of the file to be loaded</param>
        public void LoadFromFile(string filename)
        {
            _arEntries.Clear();
            _hsEntries.Clear();
            char[]       delim = new char[] { '\t' };
            StreamReader sra   = new StreamReader(filename);

            // discard first header line
            sra.ReadLine();

            // read remainder of lines and create new Statistics Entries
            while (!sra.EndOfStream)
            {
                string[] thisLine = sra.ReadLine().Split(delim);
                // set lines that begin with "#" to not be run
                bool perform = true;
                if (thisLine[0].StartsWith("#"))
                {
                    perform = false;
                }
                StatisticsEntry se = new StatisticsEntry(thisLine[COL_NAME].Replace("#", ""), thisLine[COL_R_EXPR], Convert.ToInt32(thisLine[COL_NUM_INPUTS]), thisLine[COL_OUTPUT_TYPE]);
                this.Add(se);
                se.Perform = perform;
            }

            sra.Close();
        }
Example #2
0
        /// <summary>
        /// return a duplicate of this StatisticsEntry, except for the result
        /// </summary>
        /// <returns></returns>
        public StatisticsEntry Copy()
        {
            StatisticsEntry copy = new StatisticsEntry(_name, _RCall, _numInputs, _outputType);

            copy.Perform = _perform;
            return(copy);
        }
Example #3
0
 public void Add(StatisticsEntry stat)
 {
     _arEntries.Add(stat);
     _hsEntries.Add(stat.Name, stat);
 }