Пример #1
0
        public void SplashView(SudokuTool.TestResult testResults, EvolutionStats stats, int[][] originalMatrix,
                               int[][] bestMatrix)
        {
            Console.Clear();
            DisplayMatrix(originalMatrix);
            Console.WriteLine("\nSearching for Best solution: \n");


            if (testResults.isOptimal == false)
            {
                Console.ForegroundColor = (ConsoleColor.Red);
                Console.WriteLine(" Did not find optimal solution \nBest solution found: \n");
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.WriteLine("Optimal solution found. \n");
            }

            DisplayMatrix(bestMatrix);

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine(" -- Statistics -- ");
            Console.ForegroundColor = ConsoleColor.Yellow;

            // show some stats
            Console.WriteLine($@"Final Status: {testResults.resultStatus}
Errors: {testResults.errorCount}
-- Stats -- 
| Epochs (years): {stats.epochsCompleted} 
| Mass Extinctions (resets): {stats.extinctions} 
| Organisms Created: {stats.organismsBorn} | Died of Old Age (>999 years): {stats.diedOfOldAge} 
| Mutation Fails: {stats.mutationFailed} | Evolution Successes: {stats.evolutionWorked} 
| Worst Replaced by Mating Results: {stats.culledCount} | Mating Results Were Best: {stats.bestBabies} 
| Rare Mutation Was Best: {stats.bestMutationsEver} | Random Solution Was Best: {stats.randomWasTheBest} ");

            var mutationvsevolution = ((double)stats.bestMutationsEver / stats.evolutionWorked);


            double ccRatio = (double)stats.culledCount / stats.organismsBorn;

            double meRatio = (double)stats.mutationFailed / stats.evolutionWorked;

            double mpbbRatio = (double)stats.bestBabies / stats.matingPairs;


            double rbbbRatio = (double)stats.randomWasTheBest / stats.bestMutationsEver;
        }
Пример #2
0
 public void SplashView(SudokuTool.TestResult testResults, EvolutionStats stats, int[][] originalMatrix,
                        int[][] bestMatrix)
 {
     // System.Diagnostics.Debug.Clear();
     DisplayMatrix(originalMatrix);
     System.Diagnostics.Debug.WriteLine("\nSearching for Best solution: \n");
     //System.Diagnostics.Debug.ForegroundColor = ConsoleColor.Cyan;
     DisplayMatrix(bestMatrix);
     // Console.ForegroundColor = ConsoleColor.Green;
     System.Diagnostics.Debug.WriteLine(" -- Statistics -- ");
     // Console.ForegroundColor = ConsoleColor.Yellow;
     System.Diagnostics.Debug.WriteLine($"Epochs Completed: {stats.epochsCompleted}");
     System.Diagnostics.Debug.WriteLine($"Great Extinctions: {stats.extinctions}");
     System.Diagnostics.Debug.WriteLine($"{stats.diedOfOldAge} organisms aged-out.");
     System.Diagnostics.Debug.WriteLine($"{stats.culledCount} organisms culled.");
 }