public void AddGame(OPSGame game) { if (game != null && (games == null || !games.ContainsValue(game))) { games.Add(game.GameNumber, game); } }
public static void TestModel(BasicNetwork net, int gameNumber) { OPSGame game = Parser.ParseUrl(gameNumber); if (game == null) { Console.WriteLine("Empty Page"); return; } Console.WriteLine("Expected outcome:"); Console.WriteLine(game.TeamScores[0] + ", " + game.TeamScores[1]); Console.WriteLine("Perdicted outcome:"); Console.WriteLine(net.FeedForward(ToFloatArray(game.PlayerOPS))[0] + ", " + net.FeedForward(ToFloatArray(game.PlayerOPS))[1]); }
public static void GetDataThrough(int minGameNumber, int maxGameNumber) { string dataPath = Directory.GetCurrentDirectory() + @"\..\..\Data"; // If min and max is fliped if (minGameNumber > maxGameNumber) { int temp = maxGameNumber; maxGameNumber = minGameNumber; minGameNumber = temp; } Console.WriteLine("=========>Starting to collect data<========="); for (int i = maxGameNumber; i >= minGameNumber; i--) { Console.WriteLine($"Getting game data for {i}..."); OPSData data = OPSData.GetData(dataPath, "data"); // Check if there is no game data and is not empty game if (data.GetGame(i) == null && !data.emptyGames.Contains(i)) { // Parse Game and update it to the data OPSGame game = Parser.ParseUrl(i); if (game != null) { data.AddGame(game); Console.WriteLine(" > Adding game stats."); } else { data.AddEmptyGame(i); Console.WriteLine(" > Adding empty game"); } data.SaveData(dataPath, "data"); } Console.WriteLine($"Data updated for {i}..."); } }