Skip to content

Commit

Permalink
Add min matchups
Browse files Browse the repository at this point in the history
  • Loading branch information
BenBrostoff committed Dec 27, 2023
1 parent c5f774b commit 623c04e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions draftfast/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(
self.locked_for_exposure = exposure_dict.get("locked", [])
self.custom_rules = settings.custom_rules
self.min_teams = rule_set.min_teams or settings.min_teams
self.min_matchups = rule_set.min_matchups or settings.min_matchups
self.position_per_team_rules = rule_set.position_per_team_rules

self.player_to_idx_map = {}
Expand Down
2 changes: 2 additions & 0 deletions draftfast/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(
defensive_positions=None,
max_players_per_team=None,
min_teams=None,
min_matchups=None,
position_per_team_rules=None,
game_type="classic",
):
Expand All @@ -41,6 +42,7 @@ def __init__(
self.max_players_per_team = max_players_per_team or (roster_size - 1)
self.position_per_team_rules = position_per_team_rules
self.min_teams = min_teams
self.min_matchups = min_matchups


DK_NBA_RULE_SET = RuleSet(
Expand Down
2 changes: 2 additions & 0 deletions draftfast/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def __init__(
no_defense_against_captain=False,
showdown_teams=None,
min_teams=2,
min_matchups=1,
custom_rules=None,
):
self.stacks = stacks
Expand All @@ -118,6 +119,7 @@ def __init__(
self.no_defense_against_captain = no_defense_against_captain
self.showdown_teams = showdown_teams
self.min_teams = min_teams
self.min_matchups = min_matchups
self.custom_rules = custom_rules

# TODO: format this like a proper repr(), i.e. <OptimizerSettings: ...>
Expand Down

0 comments on commit 623c04e

Please sign in to comment.