Exemplo n.º 1
0
    // *** end of global SYN and SEM declarations from ATG ***



    private static void NT_Experiments()
    {
        for (;;)
        {
            switch (Syn.Interpret())
            {
            case 0:
                return;

            case 1:
                NT_Experiment();
                break;

            case 2:
                NT_Experiment();
                break;

            case 3: // SEM
                Console.WriteLine("Experiments: ");
                foreach (Experiment e in experiments)
                {
                    Console.WriteLine(e);
                }


                ExperimentMetrics metrics = new ExperimentMetrics(experiments);

                Console.WriteLine("Number of Experiments: " + metrics.GetNumberOfExperiments());

                Console.WriteLine("Total Amount used per Ingredient:");
                foreach (Ingredient ingredient in metrics.GetIngredientsTotalUsed())
                {
                    Console.WriteLine("  " + ingredient);
                }

                Console.WriteLine("Average Amount used per Ingredient:");
                foreach (Ingredient ingredient in metrics.GetIngredientsAverageUsed())
                {
                    Console.WriteLine("  " + ingredient);
                }

                break;
            } // switch
        }     // for
    }         // NT_Experiments
Exemplo n.º 2
0
    // *** end of global SYN and SEM declarations from ATG ***
    private static void NT_Experiments()
    {
        for (;;) {
          switch (Syn.Interpret()) {
        case 0:
          return;
        case 1:
          NT_Experiment();
          break;
        case 2:
          NT_Experiment();
          break;
        case 3: // SEM
          Console.WriteLine("Experiments: ");
          			foreach (Experiment e in experiments) {
          				Console.WriteLine(e);
          			}

          			ExperimentMetrics metrics = new ExperimentMetrics(experiments);

          			Console.WriteLine("Number of Experiments: " + metrics.GetNumberOfExperiments());

          			Console.WriteLine("Total Amount used per Ingredient:");
          			foreach (Ingredient ingredient in metrics.GetIngredientsTotalUsed()) {
          				Console.WriteLine("  " + ingredient);
          			}

          			Console.WriteLine("Average Amount used per Ingredient:");
          			foreach (Ingredient ingredient in metrics.GetIngredientsAverageUsed()) {
          				Console.WriteLine("  " + ingredient);
          			}

          break;
          } // switch
        } // for
    }