コード例 #1
0
        public Measurement.MeasurementResultSet RunBenchmark(Testcase testcase, VariableCache.ConstraintMode constraintMode, PdlFilter.Filtermode filtermode, IDictionary <PDLPred, Measurement.SingleMeasurementResult> cache, IDictionary <Automaton <BDD>, Measurement.SingleMeasurementResult> automatonCache)
        {
            ICollection <PDLPred> bareResults = new LinkedList <PDLPred>();

            System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
            stopwatch.Start();
            foreach (PDLPred result in AutomataPDL.ProblemGeneration.GeneratePDLWithEDn(testcase.language, testcase.alphabet, constraintMode, filtermode))
            {
                bareResults.Add(result);
            }
            stopwatch.Stop();

            return(new Measurement.MeasurementResultSet(testcase.language, bareResults, stopwatch.ElapsedMilliseconds, constraintMode, filtermode, new HashSet <char>(testcase.alphabet), cache, automatonCache));
        }
コード例 #2
0
        public void RunAndOutputBenchmarkSet(Testcase testcase)
        {
            IDictionary <PDLPred, Measurement.SingleMeasurementResult>         cache          = new Dictionary <PDLPred, Measurement.SingleMeasurementResult>();
            IDictionary <Automaton <BDD>, Measurement.SingleMeasurementResult> automatonCache = new Dictionary <Automaton <BDD>, Measurement.SingleMeasurementResult>();

            foreach (VariableCache.ConstraintMode constraintMode in System.Enum.GetValues(typeof(VariableCache.ConstraintMode)))
            {
                foreach (PdlFilter.Filtermode filtermode in System.Enum.GetValues(typeof(PdlFilter.Filtermode)))
                {
                    Measurement.MeasurementResultSet resultSet = this.RunBenchmark(testcase, constraintMode, filtermode, cache, automatonCache);
                    using (System.IO.StreamWriter writer = new System.IO.StreamWriter(this.GetFilenameTest(testcase, constraintMode, filtermode)))
                    {
                        resultSet.Output(writer);
                    }
                }
            }
        }
コード例 #3
0
 private string GetFilenameTest(Testcase testcase, VariableCache.ConstraintMode constraintMode, PdlFilter.Filtermode filtermode)
 {
     return String.Format("C:/Users/alexander/Desktop/results/{0}.{1}.{2}.csv", testcase.id, constraintMode, filtermode);
 }
コード例 #4
0
        public Measurement.MeasurementResultSet RunBenchmark(Testcase testcase, VariableCache.ConstraintMode constraintMode, PdlFilter.Filtermode filtermode, IDictionary<PDLPred, Measurement.SingleMeasurementResult> cache, IDictionary<Automaton<BDD>, Measurement.SingleMeasurementResult> automatonCache)
        {
            ICollection<PDLPred> bareResults = new LinkedList<PDLPred>();

            System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
            stopwatch.Start();
            foreach(PDLPred result in ProblemGeneration.GeneratePDLWithEDn(testcase.language, testcase.alphabet, constraintMode, filtermode)) {
                bareResults.Add(result);
            }
            stopwatch.Stop();

            return new Measurement.MeasurementResultSet(testcase.language, bareResults, stopwatch.ElapsedMilliseconds, constraintMode, filtermode, new HashSet<char>(testcase.alphabet), cache, automatonCache);
        }
コード例 #5
0
 public void RunAndOutputBenchmarkSet(Testcase testcase)
 {
     IDictionary<PDLPred, Measurement.SingleMeasurementResult> cache = new Dictionary<PDLPred, Measurement.SingleMeasurementResult>();
     IDictionary<Automaton<BDD>, Measurement.SingleMeasurementResult> automatonCache = new Dictionary<Automaton<BDD>, Measurement.SingleMeasurementResult>();
     foreach (VariableCache.ConstraintMode constraintMode in System.Enum.GetValues(typeof(VariableCache.ConstraintMode)))
     {
         foreach (PdlFilter.Filtermode filtermode in System.Enum.GetValues(typeof(PdlFilter.Filtermode)))
         {
             Measurement.MeasurementResultSet resultSet = this.RunBenchmark(testcase, constraintMode, filtermode, cache, automatonCache);
             using (System.IO.StreamWriter writer = new System.IO.StreamWriter(this.GetFilenameTest(testcase, constraintMode, filtermode)))
             {
                 resultSet.Output(writer);
             }
         }
     }
 }
コード例 #6
0
        public void Measure_2()
        {
            Testcase testcase = TestPredicateFactory.createTestFormula2();

            RunAndOutputBenchmarkSet(testcase);
        }
コード例 #7
0
 private string GetFilenameTest(Testcase testcase, VariableCache.ConstraintMode constraintMode, PdlFilter.Filtermode filtermode)
 {
     return(String.Format("C:/Users/alexander/Desktop/results/{0}.{1}.{2}.csv", testcase.id, constraintMode, filtermode));
 }