private static void GenerateTestResults() { var referencePareto = LoadReferencePareto(); NsgaHelper.AssignCrowdingDistances(referencePareto.ResultPoints); var filteredIndividuals = referencePareto.ResultPoints.OrderByDescending(i => i.CrowdingDistance).Take(150).ToList(); var nadir = FindNadir(filteredIndividuals); var referenceParetoHyperVolume = RInvoker.HyperVolume(filteredIndividuals, nadir); var results = LoadResults(OutputsDirectory); var counter = 0; var counterMax = results.Count; foreach (var result in results) { try { result.HyperVolume = referenceParetoHyperVolume - RInvoker.HyperVolume(result.ResultPoints, nadir); result.EpsilonIndicator = RInvoker.Epsilon(result.ResultPoints, referencePareto.ResultPoints); } catch (Exception e) { Console.WriteLine("error in caling R script\n " + e.Message); } counter++; Console.WriteLine($"{counter}/{counterMax}"); } WriteToCsv(OutputsDirectory, results); SaveAverageValues(results); Console.WriteLine("done"); }
private static void TestMethod() { var results = LoadResults(OutputsDirectory); var referencePareto = LoadReferencePareto(); var epsilons = new List <double>(); foreach (var result in results) { var eps = RInvoker.Epsilon(result.ResultPoints, referencePareto.ResultPoints); epsilons.Add(eps); } Console.ReadLine(); }