Ejemplo n.º 1
0
        public TopicStreamResult(TopicStreamConfigure configure)
            : base(_folder + "\\" + configure.Index + ".txt")
        {
            Index                    = configure.Index;
            DataType                 = configure.DataType;
            CopyFactor               = configure.CopyFactor;
            FocusCount               = configure.FocusCount;
            DefaultTreeCut           = configure.DefaultTreeCut;
            DefaultTreeCutRandomSeed = configure.DefaultTreeCutRandomSeed;
            TreeCount                = configure.TreeCount;

            if (!Directory.Exists(_folder))
            {
                Directory.CreateDirectory(_folder);
            }
        }
Ejemplo n.º 2
0
        //public void StartEbola(int[] focusSeeds)
        public void StartEbola()
        {
            // -- node counts --
            string folder    = @"D:\Project\StreamingRoseRiver\EbolaCaseStudyFinal\Trees3\";
            string exeFolder = @"D:\Project\StreamingRoseRiver\EbolaCaseStudyFinal\RoseRiver\RoseRiver\bin\x64\Release\";

            if (!Directory.Exists(folder))
            {
                folder    = @"H:\Xiting\StreamingRoseRiver\ScalabilityExperiment\Data\Trees3\";
                exeFolder = @"H:\Xiting\StreamingRoseRiver\ScalabilityExperiment\RoseRiverExe\";
            }
            if (!Directory.Exists(folder))
            {
                folder    = @"D:\Documents\roseriver\RoseRiver\RoseRiver\Data\Ebola\Trees3\";
                exeFolder = @"D:\Documents\roseriver\RoseRiver\RoseRiver\Data\Ebola\ScalabilityExperiment\RoseRiver\RoseRiver\bin\x64\Release\";
            }

            List <int> nodeCounts = new List <int>();

            for (int i = 0; i < 30; i++)
            {
                var fileName = folder + i + ".gv";
                var tree     = BRTAnalysis.ReadTree(fileName);
                nodeCounts.Add(tree.BFS(tree.Root).Count());
            }

            // -- experiment --
            var copyFactors = new[] { 1 };              //Util.GetIntArray(1, 9, 2); //new[] {1, 2, 5, 10, 20, 50};
            var focusCounts = new[] { 1, 3, 5 };        //DataProcess.Utils.Util.GetIntArray(1, 5);
            //var focusSampleCount = 1;//50;
            var focusSeeds = Util.GetIntArray(51, 100); //Util.GetIntArray(1, 50); //new[] { 1 };//Util.GetIntArray(1, 50);
            //var minMaxTreeCount = 10;
            //var maxMaxTreeCount = 30;
            var treeCounts = Util.GetIntArray(5, 30); //new int[] { 5, 10 };//new[] {10, 20};
            int index      = 0;

            ProgramProgress progress =
                new ProgramProgress(copyFactors.Length * focusCounts.Length * focusSeeds.Length * treeCounts.Length);
            var configure = new TopicStreamConfigure();

            foreach (int focusSeed in focusSeeds)
            {
                foreach (var copyFactor in copyFactors)
                {
                    configure.CopyFactor = copyFactor;
                    foreach (var focusCount in focusCounts)
                    {
                        configure.FocusCount     = focusCount;
                        configure.DefaultTreeCut = GetRandomManuallyTreeCut(focusCount, treeCounts.Min(), focusSeed,
                                                                            nodeCounts, 1);
                        configure.DefaultTreeCutRandomSeed = focusSeed;
                        foreach (var treeCount in treeCounts)
                        {
                            if (File.Exists("RunTimeExperiment\\" + index + ".txt"))
                            {
                                Console.WriteLine("Skip index = " + index);
                                index++;
                                progress.PrintSkipExperiment();
                                continue;
                            }

                            configure.TreeCount = treeCount;
                            configure.Index     = index;
                            configure.Write();

                            File.Copy(TopicStreamConfigure.ConfigureFileName,
                                      exeFolder + TopicStreamConfigure.ConfigureFileName, true);

                            ProcessStartInfo startInfo = new ProcessStartInfo();
                            startInfo.ErrorDialog     = false;
                            startInfo.CreateNoWindow  = false;
                            startInfo.UseShellExecute = false;
                            startInfo.FileName        = exeFolder + @"RoseRiver.exe";
                            startInfo.WindowStyle     = ProcessWindowStyle.Normal;

                            using (Process exeProcess = Process.Start(startInfo))
                            {
                                exeProcess.WaitForExit();
                            }

                            progress.PrintIncrementExperiment("\n");
                            index++;
                        }
                    }
                }
            }

            progress.PrintTotalTime();
        }
Ejemplo n.º 3
0
        public void StartKDD()
        {
            // -- node counts --
            string     folder     = @"D:\Project\StreamingRoseRiver\EbolaCaseStudyFinal\RoseRiver\Data\KddInfovisGraphicsIndex_Lucene_a=0.003_sm=1\";
            string     exeFolder  = @"D:\Project\StreamingRoseRiver\EbolaCaseStudyFinal\RoseRiver\RoseRiver\bin\x64\Release\";
            List <int> nodeCounts = new List <int>();

            for (int i = 0; i < 11; i++)
            {
                var fileName = folder + i + ".gv";
                var tree     = BRTAnalysis.ReadTree(fileName);
                nodeCounts.Add(tree.BFS(tree.Root).Count());
            }

            // -- experiment --
            var copyFactors      = new[] { 2, 1 };
            var focusCounts      = DataProcess.Utils.Util.GetIntArray(1, 5);
            var focusSampleCount = 5;
            var minMaxTreeCount  = 6;
            var maxMaxTreeCount  = 8;
            int index            = 0;

            ProgramProgress progress  = new ProgramProgress(copyFactors.Length * focusCounts.Length * focusSampleCount * (maxMaxTreeCount - minMaxTreeCount + 1));
            var             configure = new TopicStreamConfigure();

            configure.DataType = "kdd";
            foreach (var copyFactor in copyFactors)
            {
                configure.CopyFactor = copyFactor;
                foreach (var focusCount in focusCounts)
                {
                    for (int iFocusSample = 0; iFocusSample < focusSampleCount; iFocusSample++)
                    {
                        configure.FocusCount               = focusCount;
                        configure.DefaultTreeCut           = GetRandomManuallyTreeCut(focusCount, minMaxTreeCount, iFocusSample, nodeCounts, 1);
                        configure.DefaultTreeCutRandomSeed = iFocusSample;
                        for (int iMaxTreeCount = minMaxTreeCount; iMaxTreeCount <= maxMaxTreeCount; iMaxTreeCount++)
                        {
                            configure.TreeCount = iMaxTreeCount;
                            configure.Index     = index;
                            configure.Write();

                            File.Copy(TopicStreamConfigure.ConfigureFileName, exeFolder + TopicStreamConfigure.ConfigureFileName, true);

                            ProcessStartInfo startInfo = new ProcessStartInfo();
                            startInfo.CreateNoWindow  = true;
                            startInfo.UseShellExecute = false;
                            startInfo.FileName        = exeFolder + @"RoseRiver.exe";
                            startInfo.WindowStyle     = ProcessWindowStyle.Hidden;

                            using (Process exeProcess = Process.Start(startInfo))
                            {
                                exeProcess.WaitForExit();
                            }

                            progress.PrintIncrementExperiment("\n");
                            index++;
                        }
                    }
                }
            }

            progress.PrintTotalTime();
        }