Exemplo n.º 1
0
 public Tuple <SolutionParameters, Searchspace, double> CreateRandom()
 {
     for (int i = 0; i < 32; i++)
     {
         var guess = SolutionParameters.FromFactory(_random.Next(10, 28), _random.Next(10, 28), Factory);
         try
         {
             var solution = GenerateSolution(guess);
             var cost     = Grader.CostForSolution(solution);
             return(new Tuple <SolutionParameters, Searchspace, double>(guess, solution, cost));
         }
         catch (InvalidOperationException) { }
         catch (IndexOutOfRangeException) { }
     }
     return(null);
 }