Example #1
0
 /// <summary>
 /// Returns a boolean value that determines of the given process run result
 /// can participate in the best result challenge.
 /// </summary>
 /// <param name="result"></param>
 /// <returns></returns>
 public virtual bool CanConsiderAsRecord(ProcessRunAnalysis result)
 {
     if (result == null)
     {
         throw new ArgumentNullException(nameof(result));
     }
     return(result.Status == ResultStatus.Success);
 }
        protected override IReadOnlyDictionary <string, string> AggregateProperties(IEnumerable <ProcessRunResults> results)
        {
            int    sat = 0, unsat = 0, unknown = 0, overPerf = 0, underPerf = 0, tsat = 0, tunsat = 0, tunk = 0;
            double timeSat = 0.0, timeUnsat = 0.0;

            foreach (ProcessRunResults result in results)
            {
                ProcessRunAnalysis analysis = result.Analysis;
                int _sat    = int.Parse(analysis.OutputProperties[KeySat], CultureInfo.InvariantCulture);
                int _unsat  = int.Parse(analysis.OutputProperties[KeyUnsat], CultureInfo.InvariantCulture);
                int _unk    = int.Parse(analysis.OutputProperties[KeyUnknown], CultureInfo.InvariantCulture);
                int _tsat   = int.Parse(analysis.OutputProperties[KeyTargetSat], CultureInfo.InvariantCulture);
                int _tunsat = int.Parse(analysis.OutputProperties[KeyTargetUnsat], CultureInfo.InvariantCulture);
                int _tunk   = int.Parse(analysis.OutputProperties[KeyTargetUnknown], CultureInfo.InvariantCulture);

                if (analysis.Status != ResultStatus.Bug)
                {
                    sat     += _sat;
                    unsat   += _unsat;
                    unknown += _unk;

                    tsat   += _tsat;
                    tunsat += _tunsat;
                    tunk   += _tunk;

                    if (_sat > 0)
                    {
                        timeSat += result.Runtime;
                    }
                    if (_unsat > 0)
                    {
                        timeUnsat += result.Runtime;
                    }
                }

                if (analysis.Status == ResultStatus.Success && _sat + _unsat > _tsat + _tunsat && _unk < _tunk)
                {
                    overPerf++;
                }
                if (_sat + _unsat < _tsat + _tunsat || _unk > _tunk)
                {
                    underPerf++;
                }
            }
            return(new Dictionary <string, string>
            {
                { KeySat, sat.ToString() },
                { KeyUnsat, unsat.ToString() },
                { KeyUnknown, unknown.ToString() },
                { KeyOverperformed, overPerf.ToString() },
                { KeyUnderperformed, underPerf.ToString() },
                { KeyTimeSat, timeSat.ToString() },
                { KeyTimeUnsat, timeUnsat.ToString() },
                { KeyTargetSat, tsat.ToString() },
                { KeyTargetUnsat, tunsat.ToString() },
                { KeyTargetUnknown, tunk.ToString() },
            });
        }
        public override bool CanConsiderAsRecord(ProcessRunAnalysis result)
        {
            int _sat   = int.Parse(result.OutputProperties[KeySat], CultureInfo.InvariantCulture);
            int _unsat = int.Parse(result.OutputProperties[KeyUnsat], CultureInfo.InvariantCulture);
            int _unk   = int.Parse(result.OutputProperties[KeyUnknown], CultureInfo.InvariantCulture);

            return(result.Status == ResultStatus.Success &&
                   _unk == 0 &&
                   _sat + _unsat > 0);
        }
        public override string[] GetTags(ProcessRunAnalysis result)
        {
            int _sat    = int.Parse(result.OutputProperties[KeySat], CultureInfo.InvariantCulture);
            int _unsat  = int.Parse(result.OutputProperties[KeyUnsat], CultureInfo.InvariantCulture);
            int _unk    = int.Parse(result.OutputProperties[KeyUnknown], CultureInfo.InvariantCulture);
            int _tsat   = int.Parse(result.OutputProperties[KeyTargetSat], CultureInfo.InvariantCulture);
            int _tunsat = int.Parse(result.OutputProperties[KeyTargetUnsat], CultureInfo.InvariantCulture);
            int _tunk   = int.Parse(result.OutputProperties[KeyTargetUnknown], CultureInfo.InvariantCulture);

            if (_sat + _unsat < _tsat + _tunsat || _unk > _tunk)
            {
                return new string[] { TagUnderperformers }
            }
            ;
            return(new string[0]);
        }
Example #5
0
 public ProcessRunResults(ProcessRunAnalysis analysis, double runtime)
 {
     this.analysis = analysis;
     this.runtime  = runtime;
 }
Example #6
0
 /// <summary>
 /// Returns tags that are applicable to the process run result which
 /// then can be used in UI application to distinguish this result.
 /// </summary>
 /// <param name="result">Result of a process run for an input file.</param>
 public virtual string[] GetTags(ProcessRunAnalysis result)
 {
     return(new string[0]);
 }