Beispiel #1
0
        private static void RunInEvaluationMode()
        {
            bool ifExit = false;

            while (!ifExit)
            {
                Console.WriteLine(
                    "Please, specify analysis parameters");
                string jsonModel = null;

                while (jsonModel == null)
                {
                    Console.WriteLine(
                        "Specify path to model file:");
                    string pathToFile = Console.ReadLine();
                    jsonModel = ParseModelFile(pathToFile);
                }

                List <int> sequence = null;

                while (sequence == null)
                {
                    Console.WriteLine(
                        "Specify path to sequence file:");
                    string pathToFile = Console.ReadLine();
                    sequence = ParseSequenceFile(pathToFile);
                }

                Console.WriteLine("Starting evaluation");
                EvaluationManager manager = new EvaluationManager();
                EvaluationResult  result  = manager.Evaluate(jsonModel, sequence);
                if (result.HasErrors())
                {
                    Console.WriteLine("Evaluation failed due to the following errors:" + String.Join(", ", result.Errors.ToArray()));
                }
                else
                {
                    Console.WriteLine("Probability that the sequence has been generated by the model is " + result.Value);
                }

                Console.WriteLine("Do you want to continue? (y/n)");
                ifExit = !ParseBoolean(Console.ReadLine());
            }
            Console.WriteLine("Press Ctrl+C to exit...");
        }