예제 #1
0
        public static void Reconstruct(string prefix, string dir, bool display)
        {
            Console.WriteLine("Loading Shreds");
            var shreds = Shred.Factory(prefix, dir, false);

            Console.WriteLine("Comparing And Clusering");
            var results = Reconstructor.NaiveKruskalAlgorithm(shreds);

            Console.WriteLine("Exporting Results");
            NaiveKruskalTests.ExportResult((Cluster)results.First().Root(), Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "output.png"),
                                           Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "json.js"));
        }
예제 #2
0
        public string Reconstruct(string prefix, string dir, bool display)
        {
            StringBuilder sb = new StringBuilder();

            WriteToLog("Loading Shreds");
            var shreds = Shred.Factory(prefix, dir, false);

            WriteToLog("Comparing And Clusering");
            var results = Reconstructor.NaiveKruskalAlgorithm(shreds);

            WriteToLog("Exporting Results");
            string currentDir = Directory.GetCurrentDirectory();

            NaiveKruskalTests.ExportResult((Cluster)results.First().Root(), Path.Combine(currentDir, "output.png"),
                                           Path.Combine(currentDir, "json.js"));
            WriteToLog("Export Complete");
            return(sb.ToString());
        }