public PlayerCareerReport(
     IKeepTheTime timekeeper,
     int numberOfReportsTodo = 20) : base(timekeeper)
 {
     Season      = timekeeper.CurrentSeason(DateTime.Now);
     ReportsToDo = numberOfReportsTodo;
 }
 public SeasonProjectionReport(
     IKeepTheTime timekeeper) : base(timekeeper)
 {
     Season = timekeeper.CurrentSeason(
         DateTime.Now);
     Week = $"{timekeeper.CurrentWeek( DateTime.Now ):00}";
 }
 public DepthChartReport(IKeepTheTime timekeeper) : base(timekeeper)
 {
     Name     = "Depth Charts";
     TeamCode = "SF";
     Errors   = new List <String>();
     Season   = timekeeper.CurrentSeason();
 }
        public FantasyProjectionReporter(  IKeepTheTime timekeeper)
        {
            Name = "Fantasy Point Projections";
             TimeKeeper = timekeeper;
             var dao = new DbfPlayerGameMetricsDao();
             var scorer = new YahooProjectionScorer();
             var theWeek = TimeKeeper.CurrentWeek( DateTime.Now );
             if (theWeek.Equals( 0 )) theWeek = 1;

             Configs = new List<FantasyProjectionReportConfig>
             {
            new FantasyProjectionReportConfig
            {
               Season = TimeKeeper.CurrentSeason( DateTime.Now ),
               Week = theWeek.ToString( CultureInfo.InvariantCulture ),
               Dao = dao,
               Scorer = scorer
            }
             };

             Leagues = new List<RosterGridLeague>();
             //Leagues.Add(new RosterGridLeague {
             //   Id = Constants.K_LEAGUE_Gridstats_NFL1, Name = "Gridstats GS1"
             //});
             Leagues.Add( new RosterGridLeague
             {
            Id = Constants.K_LEAGUE_Yahoo,
            Name = "Spitzys"
             } );
             //Leagues.Add( new RosterGridLeague
             //{
             //   Id = Constants.K_LEAGUE_Rants_n_Raves,
             //   Name = "NFL.com"
             //} );
        }
        public RecordOfActualMetricsReport(IKeepTheTime timekeeper) : base(timekeeper)
        {
            Name   = "Recording Actual Player Metrics Log";
            Season = timekeeper.CurrentSeason(DateTime.Now);
            Week   = string.Format("{0:00}", timekeeper.CurrentWeek(DateTime.Now));

            Dao = new DbfPlayerGameMetricsDao();
        }
 public DepthChartReport(
     IKeepTheTime timekeeper,
     string teamCode) : base(timekeeper)
 {
     Season   = timekeeper.CurrentSeason();
     TeamCode = teamCode;
     Errors   = new List <String>();
 }
 public MetricsUpdateReport(IKeepTheTime timekeeper) : base(timekeeper)
 {
     Name   = "Metrics Update Report";
     Season = timekeeper.CurrentSeason();
     Week   = new NFLWeek(Season, timekeeper.PreviousWeek());
     Scorer = new YahooScorer(Week);
     Dao    = new DbfPlayerGameMetricsDao();
 }
 public DepthChartJob( IKeepTheTime timekeeper )
 {
     Name = "Depth Charts";
      Report = new DepthChartReport(timekeeper.CurrentSeason());
      TimeKeeper = timekeeper;
      Logger = LogManager.GetCurrentClassLogger();
      IsNflRelated = true;
 }
 public MetricsUpdateReport( IKeepTheTime timekeeper)
 {
     Name = "Metrics Update Report";
      Season = timekeeper.CurrentSeason();
       Week = new NFLWeek( Season, timekeeper.PreviousWeek());
     Scorer = new YahooScorer(Week);
     Dao = new DbfPlayerGameMetricsDao();
 }
Beispiel #10
0
 public RunReportJob( IKeepTheTime timekeeper )
 {
     Name = "Run Report job";
      Report = new RunReport();
       CheckLastRun = false;  //  dont restrict running to only when data updates
      TimeKeeper = timekeeper;
      Report.Season = TimeKeeper.CurrentSeason( DateTime.Now );
      Logger = LogManager.GetCurrentClassLogger();
 }
Beispiel #11
0
 public ScoreTally(IKeepTheTime timekeeper) : base(timekeeper)
 {
     Name             = "Team Output Projections";
     LastRun          = Utility.TflWs.GetLastRun(Name);
     Year             = timekeeper.CurrentSeason();
     ScopeInFocus     = "All Teams";
     UsingPredictions = true;
     ForceRefresh     = false;
 }
 public GameProjectionsJob(IKeepTheTime timeKeeper)
 {
     Name = "Game Projections";
      var week = string.Format( "{0:00}", timeKeeper.CurrentWeek( DateTime.Now ) );
      Report = new SeasonProjectionReport( timeKeeper.CurrentSeason( DateTime.Now ), week );
      TimeKeeper = timeKeeper;
      Logger = NLog.LogManager.GetCurrentClassLogger();
      IsNflRelated = true;
      SeasonScheduler = new SeasonScheduler();
 }
Beispiel #13
0
        public TeamRanker(IKeepTheTime timeKeeper)
        {
            TimeKeeper = timeKeeper;
            RatingsHt  = new Hashtable();
            Week       = TimeKeeper.PreviousWeek();
            FileOut    = $@"{Utility.OutputDirectory()}\\{
				TimeKeeper.CurrentSeason()
				}\\Metrics\\MetricTable-{Week:0#}.htm"                ;
            Logger     = LogManager.GetCurrentClassLogger();
            Breakdowns = new PreStyleBreakdown();
        }
 public RecordActualMetricsJob(IKeepTheTime timeKeeper)
 {
     Name = "Record Actual Metrics";
      Console.WriteLine("Constructing {0} ...", Name);
      var season = timeKeeper.CurrentSeason( DateTime.Now );
      var week = string.Format( "{0:00}", timeKeeper.CurrentWeek(DateTime.Now) );
      Report = new RecordOfActualMetricsReport( season, week );
      TimeKeeper = timeKeeper;
      Logger = NLog.LogManager.GetCurrentClassLogger();
      IsNflRelated = true;
 }
 public DeletePlayerReportsReport(IKeepTheTime timekeeper) : base(timekeeper)
 {
     Name      = "Delete-Stale-Player-Reports";
     Season    = timekeeper.CurrentSeason(DateTime.Now);
     PreReport = new SimplePreReport
     {
         ReportType   = Name,
         Folder       = "Players",
         Season       = Season,
         InstanceName = $"PlayerReportsDeleted-{Season}"
     };
 }
        public PreviousPickupChartJob( IKeepTheTime timekeeper, IHistorian historian )
        {
            Name = "Previous Pickup Chart";
             TimeKeeper = timekeeper;
             Logger = LogManager.GetCurrentClassLogger();
             Historian = historian;

             Week = Int32.Parse( TimeKeeper.PreviousWeek() );

             Report = new PickupChart(
            TimeKeeper.CurrentSeason( DateTime.Now ), Week );
        }
 public RetirePlayersReport(IKeepTheTime timekeeper) : base(timekeeper)
 {
     Name      = "Retire-Player-Reports";
     Season    = timekeeper.CurrentSeason(DateTime.Now);
     PreReport = new SimplePreReport
     {
         ReportType   = Name,
         Folder       = "Players",
         Season       = Season,
         InstanceName = $"PlayersProbablyRetired-{Season}"
     };
 }
Beispiel #18
0
 public FantasyScorecardReport(
     IKeepTheTime timekeeper,
     IPlayerGameMetricsDao pgmDao) : base(timekeeper)
 {
     Name           = "Fantasy Scorecard";
     Season         = timekeeper.CurrentSeason();
     Week           = timekeeper.Week;
     PlayerIds      = new List <string>();
     PgmDao         = pgmDao;
     ScoreCards     = new List <ScoreCard>();
     TotalScoreCard = new ScoreCard();
 }
 public PickupChartJob( IKeepTheTime timekeeper, bool previous = false )
 {
     Name = "Pickup Chart";
      TimeKeeper = timekeeper;
      Logger = LogManager.GetCurrentClassLogger();
      if ( previous )
     Week = Int32.Parse( TimeKeeper.PreviousWeek() );
      else
     Week = TimeKeeper.CurrentWeek( DateTime.Now );
      if (Week == 0) Week = 1;  //  in preseason lets look ahead to the first game
      Report = new PickupChart(
     TimeKeeper.CurrentSeason( DateTime.Now ), Week );
 }
        public RosterGridReport(IKeepTheTime timekeeper)
        {
            Logger = LogManager.GetCurrentClassLogger();

            //  default to look at the current season
            MyRunStorer = new DbfRunStorer();
            Stopwatch   = new Stopwatch();
            Stopwatch.Start();
            TimeKeeper = timekeeper;
            Season     = TimeKeeper.CurrentSeason();
            TflFolder  = Config.TflFolder();
            SetLastRunDate();
        }
Beispiel #21
0
 private void Initialise(IKeepTheTime timekeeper)
 {
     Name  = "Role Assignment Report";
     Lines = new List <String> {
         Name
     };
     Season = timekeeper.CurrentSeason(DateTime.Now);
     Aces   = new List <string>();
     if (Logger == null)
     {
         Logger = LogManager.GetCurrentClassLogger();
     }
 }
Beispiel #22
0
 public PickupChart(
     IKeepTheTime timekeeper,
     int week,
     bool playerReports = false) : base(timekeeper)
 {
     Name   = "Pickup Chart";
     Season = timekeeper.CurrentSeason(DateTime.Now);
     Week   = week;
     Report = new SimplePreReport
     {
         ReportType   = "Pickup Chart",
         Folder       = "Projections",
         Season       = Season,
         InstanceName = $"Pickup-Chart-Week-{Week:0#}"
     };
     PickupSummary = new PickupSummary(timekeeper, week);
     PlayerReports = playerReports;
 }
        public FantasyProjectionReporter(IKeepTheTime timekeeper) : base(timekeeper)
        {
            Name       = "Fantasy Point Projections";
            TimeKeeper = timekeeper;
            var dao     = new DbfPlayerGameMetricsDao();
            var scorer  = new YahooProjectionScorer();
            var theWeek = TimeKeeper.CurrentWeek(DateTime.Now);

            if (theWeek.Equals(0))
            {
                theWeek = 1;
            }

            Configs = new List <FantasyProjectionReportConfig>
            {
                new FantasyProjectionReportConfig
                {
                    Season = TimeKeeper.CurrentSeason(DateTime.Now),
                    Week   = theWeek.ToString(CultureInfo.InvariantCulture),
                    Dao    = dao,
                    Scorer = scorer
                }
            };

            Leagues = new List <RosterGridLeague>();
            //Leagues.Add(new RosterGridLeague {
            //   Id = Constants.K_LEAGUE_Gridstats_NFL1, Name = "Gridstats GS1"
            //});
            Leagues.Add(new RosterGridLeague
            {
                Id   = Constants.K_LEAGUE_Yahoo,
                Name = "Spitzys"
            });
            //Leagues.Add( new RosterGridLeague
            //{
            //   Id = Constants.K_LEAGUE_Rants_n_Raves,
            //   Name = "NFL.com"
            //} );
        }
Beispiel #24
0
        public SuggestedLineup(string leagueId, string ownerCode, string teamCode,
                               IKeepTheTime timekeeper) : base(timekeeper)
        {
#if DEBUG
            Announce($@"Suggesting a lineup for {
			 ownerCode
			 } in league {
			 leagueId
			 } team {
			 teamCode
			 } - {
			 timekeeper.Season}:{timekeeper.Week}"            );
#endif
            LeagueId  = leagueId;
            League    = new FantasyLeague(leagueId);
            TeamCode  = teamCode;
            OwnerCode = ownerCode;
            Season    = timekeeper.CurrentSeason();
            Week      = Int32.Parse(timekeeper.Week);
            NflWeek   = new NFLWeek(Season, Week.ToString());
            if (LeagueId.Equals(Constants.K_LEAGUE_Yahoo) ||
                LeagueId.Equals(Constants.K_LEAGUE_Rants_n_Raves))
            {
                Scorer = new EspnScorer(NflWeek);
            }
            else
            {
                Scorer = new GS4Scorer(NflWeek);
            }
#if DEBUG
            Scorer.AnnounceIt = true;
#endif
            _usedPlayers      = new List <NFLPlayer>();
            RankMaster        = new Hashtable();
            IncludeFreeAgents = false;
        }
 public TeamMetricsUpdateReport( IKeepTheTime timekeeper )
 {
     Name = "Team Metrics Update Report";
      Season = timekeeper.CurrentSeason();
      Week = new NFLWeek( Season, timekeeper.PreviousWeek() );
 }
 public TeamMetricsUpdateReport(IKeepTheTime timekeeper) : base(timekeeper)
 {
     Name   = "Team Metrics Update Report";
     Season = timekeeper.CurrentSeason();
     Week   = new NFLWeek(Season, timekeeper.PreviousWeek());
 }
Beispiel #27
0
        public PerformanceReportGenerator(IKeepTheTime timekeeper) : base(timekeeper)
        {
            Logger = LogManager.GetCurrentClassLogger();
            Name   = "Fantasy Performance Reports";
            Lister = new PlayerLister(timekeeper)
            {
                WeeksToGoBack = 1,
                StartersOnly  = false
            };

            var master = new YahooMaster("Yahoo", "YahooOutput.xml");

            Logger.Trace("  using {0} which has {1} stats", master.Filename, master.TheHt.Count);

            var theWeek =
                new NFLWeek(Int32.Parse(timekeeper.CurrentSeason()),
                            weekIn: Int32.Parse(timekeeper.PreviousWeek()),
                            loadGames: false);

            var gs = new EspnScorer(theWeek)
            {
                Master = master
            };

            Configs = new List <PerformanceReportConfig>
            {
                new PerformanceReportConfig
                {
                    Category = Constants.K_QUARTERBACK_CAT,
                    Position = "QB",
                    Scorer   = gs,
                    Week     = theWeek
                },
                new PerformanceReportConfig
                {
                    Category = Constants.K_RUNNINGBACK_CAT,
                    Position = "RB",
                    Scorer   = gs,
                    Week     = theWeek
                },
                new PerformanceReportConfig
                {
                    Category = Constants.K_RECEIVER_CAT,
                    Position = "WR",
                    Scorer   = gs,
                    Week     = theWeek
                },
                new PerformanceReportConfig
                {
                    Category = Constants.K_RECEIVER_CAT,
                    Position = "TE",
                    Scorer   = gs,
                    Week     = theWeek
                },
                new PerformanceReportConfig
                {
                    Category = Constants.K_KICKER_CAT,
                    Position = "PK",
                    Scorer   = gs,
                    Week     = theWeek
                },
                //  4 weeks back
                new PerformanceReportConfig
                {
                    Category      = Constants.K_QUARTERBACK_CAT,
                    Position      = "QB",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 4
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_RUNNINGBACK_CAT,
                    Position      = "RB",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 4
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_RECEIVER_CAT,
                    Position      = "WR",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 4
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_RECEIVER_CAT,
                    Position      = "TE",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 4
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_KICKER_CAT,
                    Position      = "PK",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 4
                },

                //  1 week back
                new PerformanceReportConfig
                {
                    Category      = Constants.K_QUARTERBACK_CAT,
                    Position      = "QB",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 1
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_RUNNINGBACK_CAT,
                    Position      = "RB",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 1
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_RECEIVER_CAT,
                    Position      = "WR",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 1
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_RECEIVER_CAT,
                    Position      = "TE",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 1
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_KICKER_CAT,
                    Position      = "PK",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 1
                },
            };

            Leagues = new List <RosterGridLeague>();
            Leagues.Add(new RosterGridLeague {
                Id = Constants.K_LEAGUE_Yahoo, Name = "Spitzys League"
            });
#if !DEBUG
            Leagues.Add(new RosterGridLeague {
                Id = Constants.K_LEAGUE_Gridstats_NFL1, Name = "Gridstats GS1"
            });
            //Leagues.Add( new RosterGridLeague { Id = Constants.K_LEAGUE_Rants_n_Raves, Name = "NFL.COM" } );
#endif
        }
 private void Initialise(IKeepTheTime timekeeper)
 {
     Name = "Role Assignment Report";
      Lines = new List<String> { Name };
      Season = timekeeper.CurrentSeason( DateTime.Now );
      Aces = new List<string>();
      if ( Logger == null ) Logger = LogManager.GetCurrentClassLogger();
 }
        public PerformanceReportGenerator(IKeepTheTime timekeeper)
        {
            Logger = LogManager.GetCurrentClassLogger();
             Name = "Fantasy Performance Reports";
             Lister = new PlayerLister( timekeeper ) {
            WeeksToGoBack = 1,
            StartersOnly = false
             };

             var master = new YahooMaster( "Yahoo", "YahooOutput.xml" );
             Logger.Info( "  using {0} which has {1} stats", master.Filename, master.TheHt.Count );

             var theWeek =
            new NFLWeek( Int32.Parse( timekeeper.CurrentSeason() ),
            weekIn: Int32.Parse( timekeeper.PreviousWeek() ),
            loadGames: false );

             var gs = new EspnScorer( theWeek ) { Master = master };

             Configs = new List<PerformanceReportConfig>
            {
               new PerformanceReportConfig
                  {
                     Category = Constants.K_QUARTERBACK_CAT,
                     Position = "QB",
                     Scorer = gs,
                     Week = theWeek
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RUNNINGBACK_CAT,
                     Position = "RB",
                     Scorer = gs,
                     Week = theWeek
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RECEIVER_CAT,
                     Position = "WR",
                     Scorer = gs,
                     Week = theWeek
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RECEIVER_CAT,
                     Position = "TE",
                     Scorer = gs,
                     Week = theWeek
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_KICKER_CAT,
                     Position = "PK",
                     Scorer = gs,
                     Week = theWeek
                  },
               //  4 weeks back
               new PerformanceReportConfig
                  {
                     Category = Constants.K_QUARTERBACK_CAT,
                     Position = "QB",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 4
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RUNNINGBACK_CAT,
                     Position = "RB",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 4
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RECEIVER_CAT,
                     Position = "WR",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 4
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RECEIVER_CAT,
                     Position = "TE",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 4
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_KICKER_CAT,
                     Position = "PK",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 4
                  },

               //  1 week back
               new PerformanceReportConfig
                  {
                     Category = Constants.K_QUARTERBACK_CAT,
                     Position = "QB",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 1
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RUNNINGBACK_CAT,
                     Position = "RB",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 1
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RECEIVER_CAT,
                     Position = "WR",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 1
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RECEIVER_CAT,
                     Position = "TE",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 1
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_KICKER_CAT,
                     Position = "PK",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 1
                  },
            };

             Leagues = new List<RosterGridLeague>();
             Leagues.Add( new RosterGridLeague { Id = Constants.K_LEAGUE_Yahoo, Name = "Spitzys League" } );
            #if ! DEBUG
             Leagues.Add( new RosterGridLeague { Id = Constants.K_LEAGUE_Gridstats_NFL1, Name = "Gridstats GS1" } );
             //Leagues.Add( new RosterGridLeague { Id = Constants.K_LEAGUE_Rants_n_Raves, Name = "NFL.COM" } );
            #endif
        }