200 likes | 221 Views
Create a program for simulating fictional MLB teams over seasons, tracking player statistics. Explore economics of sports, salaries, and game strategies. Utilizes C# and Microsoft Access database for player data.
E N D
Virtual Moneyball A Baseball League Simulator By Ryan Kroening http://compsci.snc.edu/cs460/kroera
Project Definition • In Brief: • Create a program to allow the creation of fictional MLB teams and simulate their performance over a number of seasons. • Track any and all appropriate player and/or team statistics for research purposes • Why Do We Care: The Economics of Sports • The Salaries of Sports Stars • Worker Exploitation • The Problem of Data
Detailed Project Requirements • Three Key Components to the Program • Drafting • Different Draft Philosophies • Steinbrenner or Beane? • Statistics • What Wins Games? • Batting or Pitching? • Simulation • Deterministic • …yet Random • Other Requirements • Manage Multiple Teams/Leagues • Between Season Alterations • Reporting
Baseball Solved in Two Parts • Microsoft Access Database • Models the Desired League Structure • Stores User Data • Keeps Statistics • C# • User Interface • Simulation Component • Reporting (Crystal Reports)
Solid Management – Database Solution • Function #1 – Store Player Statistics
Solid Management – Database Solution • Function #2 – Model a Baseball League Commissioner Schedule League Results Teams Draft Philosophy Pitchers Batters
Solid Management – Database Solution • Other Components • Available vs. Taken Players • Keeping Historical Data – Season ID Variable Teams Selected Pitchers Selected Batters Master Player Table Master Player Table
Sharp On-Field Talent – C# Solution • Program Flow Models DB Model
Sharp On-Field Talent – C# Solution • Simulation Component – What Wins Games?
Sharp On-Field Talent – C# Solution • Simulation Component – Money, Talent, and Luck
Sharp On-Field Talent – C# Solution • Reporting
Making Cuts – Database Exceptions • Microsoft Access – A Bit Pudgy • How Granular to Make the Data? • What Does User Have Control Over? Pitchers Batters Stats Stats What Stats Matter? Commissioner League (all) Teams (one)
Making Cuts – Interface Exceptions • “To-The-Point” Interface • Fixed Player List • Multiple Draft Philosophies • Reporting Options • Data Dump vs. Full Calculation • More, More, More
Methodology • Solid Database Model • Rapid Prototyping • Get Something Working! • Dual-Program Design • Interface • Functional • “One Piece a Day” • Pick a Function/Task • Get Something Working! • Debug • Save It • Put Pieces Together Later
Demonstration • Will almost certainly outperform the Brewers…
Strategies for Learning • New Skills Acquired • C# • Visual Studio 2008 Development • Building a DB from Scratch • Learning/Developing at the Same Time • Trial and Error (Get Something Working!) • On-the-Job Training • The Internet • Google “C# AND …” • MSDN
From the Classroom to the Diamond • Database Theory/Modeling • Good Model Easier Coding • Program Flow Comes Naturally from Model • OOP Principles • Break Program Apart Into Chunks • Functions and Classes/Objects • Programming Language Theory • Need to Learn, and Learn Fast • Understood General C# First, Specifics Later
Expansion Teams/Program Extensions • Migrate from Microsoft Access to SQL Server • Performance Boost • LINQ vs. DataSet • Player Level Statistics • Randomize Individual Game Performance • Change Player Stats Throughout Season • Dynamic AI • Automatically Add/Drop Players During Season • Trade Between Teams • More Detailed Reports
Advice From An Old Pro • Get Something Working! • Obey Your Timeline • Be Honest With Yourself • “One Piece a Day” • Use Your Resources • CS Faculty • Coworkers, Friends, Past Seniors, etc. • Exercise! (trust me)
Thanks/Q&A • Thanks to the Following People for Helping Me Out: • The Entire SNC Computer Science Faculty • Dr. Kevin Quinn • The IT Department at Enzymatic Therapy • Questions and Comments from the Audience?