Пример #1
0
        public NFLBet IsBettable(NFLGame game)
        {
            NFLBet   bet         = null;
            string   revengeTeam = "";
            string   revengeGame = "";
            TimeSpan aSpan       = new TimeSpan(730, 0, 0, 0);

            DataSet   ds = tflWS.GetGamesBetween(game.HomeTeam, game.AwayTeam, DateTime.Now.Subtract(aSpan));
            DataTable dt = ds.Tables["SCHED"];

            dt.DefaultView.Sort = "GAMEDATE ASC";
            foreach (DataRow dr in dt.Rows)
            {
                if (dr.RowState != DataRowState.Deleted)
                {
                    NFLGame aGame = new NFLGame(dr);
                    if (aGame.WasRout())
                    {
                        revengeTeam = (aGame.HomeWin()) ? aGame.AwayTeam : aGame.HomeTeam;
                        revengeGame = aGame.ScoreOut(revengeTeam) + " " + aGame.GameCodeOut();
                    }
                }
            }

            if (revengeTeam.Length > 0)
            {
                bet = new NFLBet(revengeTeam, game, Name + " - " + revengeGame, ConfidenceLevel());
            }

            return(bet);
        }
Пример #2
0
        public NFLResult PredictGame(NFLGame game, IStorePredictions persistor, DateTime predictionDate)
        {
            var result = new NFLResult {
                AwayTeam = game.AwayTeam, HomeTeam = game.HomeTeam
            };

            var homeTeam = game.HomeNflTeam;
            var awayTeam = game.AwayNflTeam;

            var nHomeOff = Utility.OffRating(homeTeam, predictionDate);
            var nAwayOff = Utility.OffRating(awayTeam, predictionDate);
            var nHomeDef = Utility.DefRating(homeTeam, predictionDate);
            var nAwayDef = Utility.DefRating(awayTeam, predictionDate);

            result.HomeScore = (nHomeOff + nAwayDef) - 20;
            result.AwayScore = (nAwayOff + nHomeDef) - 20;

            persistor.StorePrediction("Miller", game, result);

            if (AuditTrail)
            {
                Utility.Announce(string.Format("{0}-{1}:{2}", game.GameCodeOut(), game.GameCode, result.LogResult()));
            }

            return(result);
        }
Пример #3
0
        private void AuditIt(
            NFLGame game,
            NFLResult res,
            int homeRating,
            int awayRating)
        {
            const string debugTeamCode = "SF";
            var          debugTeamRank = "(0-0)";

#if DEBUG
            var strVenue = "unknown";
#endif
            var          oppTeamCode = "YY";
            var          oppRank     = "(0-0)";
            const string rankFormat  = "({0})";
            var          bAudit      = false;
            if (game.HomeTeam.Equals(debugTeamCode))
            {
                bAudit = true;
#if DEBUG
                strVenue = "Home";
#endif
                oppTeamCode   = game.AwayTeam;
                oppRank       = string.Format(rankFormat, awayRating);
                debugTeamRank = string.Format(rankFormat, homeRating);
            }
            if (game.AwayTeam.Equals(debugTeamCode))
            {
                bAudit = true;
#if DEBUG
                strVenue = "Away";
#endif
                oppTeamCode   = game.HomeTeam;
                oppRank       = string.Format(rankFormat, homeRating);
                debugTeamRank = string.Format(rankFormat, awayRating);
            }
            if (!bAudit)
            {
                return;
            }

#if DEBUG
            Announce(
                $" {game.GameCodeOut()} Debug Team {debugTeamCode} {debugTeamRank}, is {strVenue} vs {oppTeamCode} {oppRank}");

            Announce(
                res.LogResult());                  //  verbosity
#endif
        }
Пример #4
0
        private static void AuditPrediction(NFLGame game, int awayDef, int awayOff, int homeOff, NFLResult res, int homeDef)
        {
            const string debugTeamCode = "GB";
            var          debugTeamRank = "(0-0)";
            var          strVenue      = "unknown";
            var          oppTeamCode   = "YY";
            var          oppRank       = "(0-0)";
            const string rankFormat    = "({0}.{1}={2})";
            var          bAudit        = false;

            if (game.HomeTeam.Equals(debugTeamCode))
            {
                bAudit        = true;
                strVenue      = "Home";
                oppTeamCode   = game.AwayTeam;
                oppRank       = string.Format(rankFormat, awayOff, awayDef, Rating(awayOff, awayDef));
                debugTeamRank = string.Format(rankFormat, homeOff, homeDef, Rating(homeOff, homeDef));
            }
            if (game.AwayTeam.Equals(debugTeamCode))
            {
                bAudit        = true;
                strVenue      = "Away";
                oppTeamCode   = game.HomeTeam;
                oppRank       = string.Format(rankFormat, homeOff, homeDef, Rating(homeOff, homeDef));
                debugTeamRank = string.Format(rankFormat, awayOff, awayDef, Rating(awayOff, awayDef));
            }
            if (!bAudit)
            {
                return;
            }
            Utility.Announce(string.Format(" {5} Debug Team {0} {1}, is {2} vs {3} {4}",
                                           debugTeamCode, debugTeamRank, strVenue, oppTeamCode, oppRank, game.GameCodeOut()));

            Utility.Announce(res.LogResult());
        }
Пример #5
0
        private static void AuditIt(NFLGame game, NFLResult res, int homeRating, int awayRating)
        {
            const string debugTeamCode = "SF";
            var          debugTeamRank = "(0-0)";
            var          strVenue      = "unknown";
            var          oppTeamCode   = "YY";
            var          oppRank       = "(0-0)";
            const string rankFormat    = "({0})";
            var          bAudit        = false;

            if (game.HomeTeam.Equals(debugTeamCode))
            {
                bAudit        = true;
                strVenue      = "Home";
                oppTeamCode   = game.AwayTeam;
                oppRank       = string.Format(rankFormat, awayRating);
                debugTeamRank = string.Format(rankFormat, homeRating);
            }
            if (game.AwayTeam.Equals(debugTeamCode))
            {
                bAudit        = true;
                strVenue      = "Away";
                oppTeamCode   = game.HomeTeam;
                oppRank       = string.Format(rankFormat, homeRating);
                debugTeamRank = string.Format(rankFormat, awayRating);
            }
            if (!bAudit)
            {
                return;
            }

#if DEBUG
            Utility.Announce(string.Format(" {5} Debug Team {0} {1}, is {2} vs {3} {4}",
                                           debugTeamCode, debugTeamRank, strVenue, oppTeamCode, oppRank, game.GameCodeOut()));

            Utility.Announce(res.LogResult());              //  verbosity
#endif
        }