public static void Main(String[] args) { var runSize = 100; var runTime = 100; List <float> ans = new List <float>(); List <String> results = new List <String>(); List <float> allResults = new List <float>(); List <float> numofDecptive = new List <float>(); List <String> allGenerationBests = new List <String>(); List <float> deceptivesInRun = new List <float>(); results.Add("Average,Best,Worst"); var par = ""; for (var a = 0; a < runTime; a++) { Results resGA = GeneticAlgorithm.runGA(runSize); ans = resGA.GenerationsTaken; par = resGA.Parameters; if (a < 1) { allGenerationBests.AddRange(resGA.GenerationResults); deceptivesInRun.Add(resGA.numOfDecptiveBits); } allResults.AddRange(ans); if (ans.Sum() == 0) { Console.WriteLine("No ideal has been found"); } Console.WriteLine("The Average of the Results are: " + ans.Average() + " At run: " + a); results.Add(ans.Average() + "," + ans.Min() + "," + ans.Max()); ans.Clear(); } results.Add(par); outputRunResults(allResults); outputGenerationBestResults(allGenerationBests); using (System.IO.StreamWriter file = new System.IO.StreamWriter("\\FYP_Results\\" + experiment + "\\results_average_" + runtype + ".csv")) { foreach (String res in results) { file.WriteLine(res); } } outputSummation(results, allResults, allGenerationBests); }