Simulating Tennis Matches with Python or Moneyball for Tennis

This would help us implement an event log type trigger where events such as tiebreaks or big points would occur if a Player object’s point count hits certain numbers.Next we would want to create a class Match and classes Set and Game that would extend Match and Set, respectively..Similar to Player class there would be many getter and setter functions to track properties of each Match, Set, and Game..The most important of these would be getScore where Match, Set, and Game would have their own copy through inheritance and since this function would be within it’s own class, no function parameters would be needed..Another interesting advantage of inheritance would be a isTiebreak and playTiebreak function in both Set and Game..isTiebreak would just return a boolean if a game or set has entered a tiebreak and playTiebreak to carry through the logic..The reason this works is because in Tennis a game is more or less an atomic unit through which sets are made..So when two players have a score of 40–40 they are really playing a mini tiebreak except the score oscillates between Deuce (D) and Advantage (A) as opposed to numeric values as is done in a tiebreak at the end of a set..We could theoretically make Game the base class and Set would extend Game and Match would extend Set, but this hasn’t been fully thought out yet.We believe the above is the best layout for this problem on a production level..This allows for greater flexibility going forward as we can easily add more attributes to each class..The code submitted, however, is a proof of concept..We can run simulations and ultimately understand whether or not there is value to running this regularly..Outside of the scope of this problem, if we were considering testing models for efficacy the function based script approach allows for a quick proof-of-concept.. More details

Leave a Reply