Ejemplo n.º 1
0
        /// <summary>
        /// Runs the comparison for a given folder.
        /// </summary>
        public static void ComparisonSuite(String graphsFolder, String resultLog, bool parallelTest, bool runLayout)
        {
            string dataFolder = Path.GetFileName(Path.GetDirectoryName(graphsFolder));
            string dateTime   = DateTime.Now.ToString("-yyyy.MM.dd-HH_mm");

            //Set the current directory.
            subFolderName = "TestSuite2-";
            Directory.CreateDirectory(subFolderName + dataFolder + dateTime);
            Directory.SetCurrentDirectory(subFolderName + dataFolder + dateTime);
            int numberCores = 1;

            if (parallelTest)
            {
                numberCores = Environment.ProcessorCount;
            }

            var testSuite = new OverlapRemovalTestSuite(resultLog);

            testSuite.overlapMethods = CollectionOverlapRemovalMethods();
            testSuite.layoutMethods  = CollectionInitialLayout(runLayout);


            string[] filePaths = Directory.GetFiles(graphsFolder, "*.dot");

            Parallel.ForEach(
                filePaths,
                new ParallelOptions {
                MaxDegreeOfParallelism = numberCores
            },
                testSuite.RunOverlapRemoval
                );

            testSuite.Finished();
        }
        private void Run()
        {
            _testDir = _argsParser.GetValueOfOptionWithAfterString("-test_dir");

            if (_testDir == null)
            {
                Console.WriteLine("-test_dir is not given, exiting");
                return;
            }
            bool run_layout;

            if (!_argsParser.OptionIsUsed("-dot"))
            {
                _graphWidth     = GetWidthOfGraph();
                _circleRadius   = _graphWidth / 10;
                _nofCircles     = GetNumberOfCircles();
                _nodesPerCircle = GetNumberOfNodesPerCircle();
                _nodeWidth      = 2 * _circleRadius / 3;
                run_layout      = false;
                CreateArtificialGraphsIfRequired();
            }
            else
            {
                run_layout = true;
            }

            OverlapRemovalTestSuite.ComparisonSuite(
                _testDir,
                "ResultsPrism-original-datasetTestSuite1.csv", false, run_layout);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Runs the comparison for a given folder.
        /// </summary>
        public static void ComparisonSuite(String graphsFolder, String resultLog, bool parallelTest, bool runLayout)
        {
            string dataFolder = Path.GetFileName(Path.GetDirectoryName(graphsFolder));
            string dateTime   = DateTime.Now.ToString("-yyyy.MM.dd-HH_mm");

            //Set the current directory.
            subFolderName = "TestSuite2-";
            Directory.CreateDirectory(subFolderName + dataFolder + dateTime);
            Directory.SetCurrentDirectory(subFolderName + dataFolder + dateTime);
            int numberCores = 1;

            if (parallelTest)
            {
                numberCores = Environment.ProcessorCount;
            }

            var testSuite = new OverlapRemovalTestSuite(resultLog);

            testSuite.overlapMethods = CollectionOverlapRemovalMethods();
            testSuite.layoutMethods  = CollectionInitialLayout(runLayout);


            string[] filePaths = Directory.GetFiles(graphsFolder, "*.dot");

            Console.WriteLine(@"total graphs  = {0} ", filePaths.Count());
            Parallel.ForEach(
                filePaths,
                new ParallelOptions {
                MaxDegreeOfParallelism = numberCores
            },
                graphFilename => testSuite.RunOverlapRemoval(graphFilename, runLayout)
                );

            int prismWins = 0;
            int gtreeWins = 0;

            foreach (var t in testSuite._errorDict)
            {
                if (t.Value.prismError < t.Value.gtreeError)
                {
                    prismWins++;
                }
                else if (t.Value.prismError > t.Value.gtreeError)
                {
                    gtreeWins++;
                }
            }
            Console.WriteLine(@"total graphs {2} prism wins {0} gtree wins {1}", prismWins, gtreeWins, filePaths.Length);
            testSuite.Finished();
        }
Ejemplo n.º 4
0
        private void Run()
        {
            _testDir = _argsParser.GetStringOptionValue("-test_dir");

            if (_testDir == null)
            {
                System.Diagnostics.Debug.WriteLine("-test_dir is not given, exiting");
                return;
            }
            bool run_layout;

            if (!_argsParser.OptionIsUsed("-dot"))
            {
                _graphWidth       = GetWidthOfGraph();
                _circleRadius     = _graphWidth / 10;
                _nofCircles       = GetNumberOfCircles();
                _nodesPerCircle   = GetNumberOfNodesPerCircle();
                _nodeWidth        = 2 * _circleRadius / 3;
                _randomNodesCount = GetRandomNodesCount();
                if (_randomNodesCount != 0)
                {
                    _circleRadius = 0;
                    _nofCircles   = 0;
                }

                run_layout = false;
                CreateArtificialGraphsIfRequired();
            }
            else
            {
                run_layout = true;
            }

            OverlapRemovalTestSuite.ComparisonSuite(
                _testDir,
                "ResultsPrism-original-datasetTestSuite1.csv", false, run_layout);
        }