generate_schedules.RdGenerate unique schedules for teams, presumably for a fantasy football league, but it doesn't actually have to be for that. Points are not simulated, just schedules
generate_schedules( league_size = .get_league_size(), weeks = .get_weeks_cutoff(), sims = 10, check_dups = TRUE, tries = ifelse(check_dups, ceiling(log(sims)), 1), ..., overwrite = FALSE, export = TRUE, dir = .get_dir_data(), file = .generate_schedules_file(league_size, weeks, sims), ext = "parquet", path = file.path(dir, sprintf("%s.%s", file, ext)), f_import = arrow::read_parquet, f_export = arrow::write_parquet )
| league_size | Number of teams in the league. Can be set globally
in the options. See |
|---|---|
| weeks | How many weeks are in schedule. Presently, this function requires
that |
| sims | How many unique simulations to generate. |
| check_dups | Whether to check for duplicates. It's recommended to leave this
as |
| tries | How many times to re-try. |
| ... | Additional parameters passed to |
| overwrite | Whether to overwrite existing file at |
| export | Whether to export. |
| dir | Directory to use to generate |
| file | Filename (without extension) to generate |
| ext | File extension to use to generate |
| path | Path to export to. |
| f_import | Function to import with if file exists and |
| f_export | Function to export with if |
This function basically uses a brute force approach, hence the tries
parameter.