예제 #1
0
        public static bool RunSimulation(string home, string away)
        {
            var context    = new AlgoTestContext();
            var leagueRepo = new LeagueRepository(context);

            var result   = PredictEngine.Predict(home, away);
            var FTResult = leagueRepo.GetFTResult(home, away);

            if (FTResult != null)
            {
                total = total + 1;
                if (FTResult == result.predictedValue)
                {
                    correct = correct + 1;
                    Console.WriteLine(result.predictedString + " - correct");
                }

                else
                {
                    Console.WriteLine(result.predictedString + " - wrong");
                }
                return(true);
            }
            return(false);
        }
예제 #2
0
 public static void Run()
 {
     while (true)
     {
         Console.Write("Enter home team: ");
         string hometeam = Console.ReadLine();
         Console.Write("Enter away team: ");
         string awayteam = Console.ReadLine();
         Console.WriteLine("predicting...");
         var result = PredictEngine.Predict(hometeam, awayteam);
         Console.WriteLine(result.predictedString);
         Console.WriteLine("");
         Console.WriteLine("Press enter to simulate again");
         Console.ReadLine();
     }
 }