private static void Main(string[] args) { Options.Parse(args); //check that the file exists before attempting to parse if (!Directory.Exists(_files)) { Console.WriteLine($"Directory \"{_files}\" does not exist"); return; } CIlibParser parser; if (_iteration < 0) //parse only final output { parser = new FinalOutputParser(); } else //parse entire file { parser = new SingleIterationParser(_iteration); } //parse either a single file or directory, depending on context List <Algorithm> algorithms = _singleFile ? new List <Algorithm> { parser.Parse(_files) } : parser.ParseDirectory(_files); string outputPath = Path.Combine(_files, "summaries"); Summarizer sum = new Summarizer(_minimum); sum.Summarize(algorithms, outputPath, _verbose); }
public static void Main(string[] args) { Options.Parse(args); //check that the file exists before attempting to parse if (!Directory.Exists(_directory)) { Console.WriteLine($"Directory \"{_directory}\" does not exist"); return; } CIlibParser parser; if (_iteration < 0) //parse only final output { parser = new FinalOutputParser(); } else //parse entire file { parser = new SingleIterationParser(_iteration); } //parse either a single file or directory, depending on context List <Algorithm> algorithms = _singleFile ? new List <Algorithm> { parser.Parse(_directory) } : parser.ParseDirectory(_directory); SuccessRateCalculator calculator = new SuccessRateCalculator(_accuracy); calculator.Calculate(algorithms); }
static void Main(string[] args) { options.Parse(args); //check that the file exists before attempting to parse if (!Directory.Exists(directory)) { Console.WriteLine($"Directory \"{directory}\" does not exist"); return; } CIlibParser parser; if (iteration < 0) //parse only final output { parser = new FinalOutputParser(); } else //parse entire file { parser = new SingleIterationParser(iteration); } List <Algorithm> algorithms = parser.ParseDirectory(directory); string outputPath = Path.Combine(directory, "summaries"); if (!Directory.Exists(outputPath)) { Directory.CreateDirectory(outputPath); } foreach (string measure in algorithms[0].Measurements.Select(x => x.Name)) { string fileName = Path.Combine(outputPath, $"{measure}.csv"); using (TextWriter writer = new StreamWriter(fileName)) { //writer.WriteLine("Algorithm,Mean,Stdandard Deviation,Min,Max"); if (verbose) { Console.WriteLine(measure); Console.WriteLine(" Alg | Min | Median | Mean | Std.Dev | Max"); } foreach (Algorithm alg in algorithms) { IterationStats stats = alg.Measurements.Find(m => m.Name == measure).FinalIteration; //get the stats for the associated measure //writer.WriteLine("{0},{1},{2},{3},{4}", alg.Name, stats.Average, stats.StandardDeviation, stats.Min, stats.Max); writer.WriteLine("{0} & {1:e2} & {2:e2} & {3:e2} & {4:e2} & {5:e2} \\\\ \\hline", alg.Name, checkMin(stats.Min), checkMin(stats.Median), checkMin(stats.Average), checkMin(stats.StandardDeviation), checkMin(stats.Max)); if (verbose) { Console.WriteLine("{0,10} | {1:0.000} | {2:0.000} | {3:0.000} | {4:0.000} | {5:0.000}", alg.Name, checkMin(stats.Min), checkMin(stats.Median), checkMin(stats.Average), checkMin(stats.StandardDeviation), checkMin(stats.Max)); } } if (verbose) { Console.WriteLine(); } } } }
public static void Main(string[] args) { Options.Parse(args); if (string.IsNullOrEmpty(_directory)) { Console.WriteLine("No directory specified, exiting."); Environment.Exit(1); } if (!Directory.Exists(_directory)) { Console.WriteLine("Invalid directory, exiting."); Environment.Exit(1); } CIlibParser parser; if (_iteration < 0) //parse only final output { parser = new FinalOutputParser(); } else //parse specific iteration { parser = new SingleIterationParser(_iteration); } List <Algorithm> algorithms = parser.ParseDirectory(_directory); foreach (Algorithm alg in algorithms) { alg.Measurements.RemoveAll(x => x.Name != "Fitness"); } //AdditionalMeasures.AddConsistency(algorithms); //AdditionalMeasures.AddSuccessRate(algorithms, 1000); StaticRanker.Rank(algorithms, _directory); }