The most enjoyable part of this project for me was implementing the NFL’s incredibly elaborate tie-breaking procedures in code: taking a plain English description of the rules (that requires some interpretation) and porting it to JavaScript.
We should be open-sourcing the simulator implementation (the model, but not the UI) soon so you can see how it works.
There was also a fun moment when I realized I could make the simulator 10x faster by computing only the seed of the selected team, rather than the full order of teams in the playoffs. This avoided a lot unnecessary sorting and tie-breaking!
This is a great project. Well executed, and looks like a blast to work on. I love the breakdown of what would be required for the Seahawks to miss the playoffs if they split their final two (it requires the Packers and Lions to tie their final game -- among other things).
This is awesome! Kudos to you and the team (I assume you had help?). Yeah, I'm sure the tie breaking procedures drove you crazy. Imagine the rules committee meetings when they discussed all of them. :) How did you manage the complexity of the rules in your mind? I'm curious as to how you went from rules => mental model/entities => code. Did you use a formal process?
Thanks, and yes, this was a collaboration with Kevin Quealy and Shan Carter.
The development process was incremental: first create a simple representation of the league (conferences, divisions, teams) and schedule (games, outcomes), then implement the necessary metrics (win percentage, strength-of-victory, etc.) and filters (e.g., head-to-head, common games), then finally the tie-breaking algorithm itself.
The incremental approach let me test the parts independently and reduce the amount of hair-pulling debugging unlikely scenarios. Though, there was still plenty of that… Fortunately the NFL has an official playoff computer I could use to test my implementation (for a single, complete scenario).
The most enjoyable part of this project for me was implementing the NFL’s incredibly elaborate tie-breaking procedures in code: taking a plain English description of the rules (that requires some interpretation) and porting it to JavaScript.
http://www.nfl.com/standings/tiebreakingprocedures
We should be open-sourcing the simulator implementation (the model, but not the UI) soon so you can see how it works.
There was also a fun moment when I realized I could make the simulator 10x faster by computing only the seed of the selected team, rather than the full order of teams in the playoffs. This avoided a lot unnecessary sorting and tie-breaking!