Beispiel #1
0
        protected virtual void RunTest(ParallelOptimizationTest test)
        {
            //tries to recover previous tests measures
            if (this.prevTestMeasuresPath != null)
            {
                test.OptimizationTestFactory.Scenario.TestMeasuresFilePath = this.prevTestMeasuresPath;
            }

            //runs test
            Console.WriteLine(@"----------------------------------------------");
            Console.WriteLine(@"Starting {0} test...", test.TestID);
            test.LogStatistics = this.TestsConfig.GraphicsEnabled;
            test.Run();

            //prints results and disposes
            Console.WriteLine(@"----------------------------------------------");
            Console.WriteLine(@"Printing test results...");

            if (this.TestsConfig.GraphicsEnabled)
            {
                test.PrintResults();
            }
            else
            {
                this.PrintTestMeasures(test);
            }

            Console.WriteLine(@"{0} test has finished.", test.TestID);

            this.prevTestMeasuresPath = test.TestMeasures.LastFilePath;

            test.Dispose();
        }
Beispiel #2
0
 protected override void RunTest(ParallelOptimizationTest test)
 {
     //starts progress form, also links close button to interrupt test
     using (var progressFormUpdater = new ProgressFormUpdater(test)
     {
         Visible = this.TestsConfig.GraphicsEnabled,
         Text = string.Format("{0}", test.TestID)
     })
     {
         progressFormUpdater.FormTerminated += test.InterruptProcessing;
         base.RunTest(test);
     }
 }
        public OptimizationScheme(ParallelOptimizationTest mainTest,
                                  IEnumerable <TopTestScheme> topTestsScheme = null, ParallelOptimizationTest finalTest = null)
        {
            if (mainTest == null)
            {
                throw new ArgumentNullException("mainTest");
            }

            this.mainTest  = mainTest;
            this.finalTest = finalTest;
            if (topTestsScheme != null)
            {
                this.topTestsScheme = topTestsScheme.ToList();
            }
        }
Beispiel #4
0
        private void PrintTestMeasures(ParallelOptimizationTest test)
        {
            //verifies path
            var filePath = Path.GetFullPath($"{test.FilePath}{Path.DirectorySeparatorChar}");

            if (!Directory.Exists(filePath))
            {
                Directory.CreateDirectory(filePath);
            }

            //prints only test measures
            var testMeasuresFilePath =
                $"{filePath}{this.TestsConfig.TestMeasuresName}{test.TestID}.csv";

            test.TestMeasures.PrintToFile(testMeasuresFilePath);
        }
 public GPOptimizationScheme(ParallelOptimizationTest mainTest, uint numSelectBestSimulations = 0,
                             IEnumerable <TopTestScheme> topTestsScheme = null, ParallelOptimizationTest finalTest = null)
     : base(mainTest, topTestsScheme, finalTest)
 {
     this._numSelectBestSimulations = numSelectBestSimulations;
 }