Exemplo n.º 1
0
 private static void PrintSchedule(SchedulingResult sr, int[] jobCosts)
 {
     if (jobCosts.Length > 25)
     {
         Console.Write("Total processing time: ");
          WriteColorLine(ConsoleColor.Yellow, "{0}", sr.ProcessingTime);
         foreach (var cpu in sr.Schedule.Keys)
         {
             Console.Write("{0}: ", cpu.Name.PadLeft(10));
             int counter = 0;
             foreach (var job in sr.Schedule[cpu].Jobs)
             {
                 if (counter++ % 2 == 0)
                     Console.Write(new string('#', jobCosts[job]));
                 else
                     Console.Write(new string('@', jobCosts[job]));
             }
             Console.WriteLine();
         }
     }
     else
     {
         Console.Write("Total processing time: ");
         WriteColorLine(ConsoleColor.Yellow, "{0}", sr.ProcessingTime);
         char[] chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray();
         int c = 0;
         foreach (var cpu in sr.Schedule.Keys)
         {
             Console.Write("{0}: ", cpu.Name.PadLeft(10));
             int counter = 0;
             foreach (var job in sr.Schedule[cpu].Jobs)
             {
                 Console.Write(new string(chars[job], jobCosts[job]));
             }
             Console.WriteLine();
         }
     }
 }
Exemplo n.º 2
0
 private static void PrintResult(SchedulingResult result, TimeSpan executionTime)
 {
     PrintSchedule(result, jobs);
     Console.Write("Algo execution time ");
     WriteColorLine(ConsoleColor.Blue, "{0}", executionTime);
 }