Documentation ¶
Index ¶
- func MatchToCSVRow(m api.Match) []string
- func MatchesToCSV(matches []api.Match, filename string) ([][]string, error)
- func OPRToCSV(oprs []OPR, filename string) ([][]string, error)
- func OPRToCSVRow(o OPR) []string
- func SummaryStatsToCSV(stats []SummaryStats, filename string) ([][]string, error)
- func SummaryStatsToCSVRow(s SummaryStats) []string
- func TeamMatches(matches []api.Match, teamKey string) ([]api.Match, error)
- func TeamMatchesToCSV(matches []api.Match, teamKey string, filename string) ([][]string, error)
- type AllianceInfo
- type OPR
- type SummaryStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchToCSVRow ¶
Function that converts a match type object to a string slice to allow writing it to a csv file. Takes in a match type object and outputs a string slice.
func MatchesToCSV ¶
Helper function that writes an array of Matches to a csv file. Takes in slice of Match types and a filename for the output csv file. Returns the output 2D array and an error. This function does not modify the global state and has the side effect of creating a file under filename.
func OPRToCSV ¶
Function OPRToCSV converts an OPR type slice into a 2D string array and then writes it to a csv file called 'filename'.
func OPRToCSVRow ¶
Function OPRToCSVRow is a helper function for OPRToCSV that converts a singular OPR object 'o' to a string slice, formatted as a csv file row.
func SummaryStatsToCSV ¶
func SummaryStatsToCSV(stats []SummaryStats, filename string) ([][]string, error)
Function SummaryStatsToCSV converts an array of SummaryStats to a 2D string array and writes the output to a csv file. It takes in a SummaryStats slice and a string for the filename and returns a 2D string slice and an error.
func SummaryStatsToCSVRow ¶
func SummaryStatsToCSVRow(s SummaryStats) []string
Function SummaryStatsToCSVRow converts a SummaryStats object to a csv row string. It takes in a SummaryStats object and outputs a string slice.
func TeamMatches ¶
Function to get a subset of matches from an event containing only matches a specified team was a part of. Takes in a pointer to the event matches object and a team key to search for. Returns a slice of matches and error. This function does not modify the global state and has no side effects
Types ¶
type AllianceInfo ¶
type AllianceInfo struct { Alliances [][]string Scores []float64 AutoScores []float64 TeleScores []float64 RP []float64 }
func GetEventAlliances ¶
func GetEventAlliances(matches []api.Match) (AllianceInfo, []string, error)
Function GetEventAlliances is a helper function for statistical analysis functions that extracts team and score info from match breakdowns. It takes in a api.Match slice and outputs an AllianceInfo object, a string slice containing all unique team keys for an event, and an error.
type OPR ¶
func CalcEventOPR ¶
Function that calculates expected contribution for each team at an event. Takes in []Match type array and outputs []OPR type array and error. Does not modify the global state and has no side effects.
type SummaryStats ¶
type SummaryStats struct { TeamKey string MeanScore float64 // MedianScore float64 // TODO: add median later MaxScore float64 // TODO: maybe make this a weighted metric to reduce outliers MeanAuto float64 MeanTeleop float64 }
func CalcTeamSummaryStats ¶
func CalcTeamSummaryStats(a AllianceInfo, teamKey string) (SummaryStats, error)
Function CalcTeamSummaryStats calculates summary statistics (mean, max, median) for each team at an event. It takes in an AllianceInfo object from alliance_utils.go and a string definining which team to evaluate statistics for. It returns a SummaryStats object and an error.