Skip to content

Commit

Permalink
Remove redundant constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
BenBrostoff committed Dec 27, 2023
1 parent 99fadf8 commit ebbf142
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion draftfast/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ def _set_min_teams(self):
>= self.solver.Sum(players_on_team)
)

if len(teams) > 0:
# If min matchups is more than 1, this constraint is redundant
if len(teams) > 0 and (self.min_matchups or 0) < 2:
self.solver.Add(self.solver.Sum(teams) >= self.min_teams)

def _set_min_matchups(self):
Expand Down
6 changes: 5 additions & 1 deletion draftfast/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ def __init__(
"""
A note on defaults:
- min_teams 2 - this constraint is common across Classic and Showdown.
min_teams 2 - this constraint is common across Classic and Showdown.
- In Showdown, you must have two teams represented, although only
one matchup exists to choose from.
- In Classic, the constraint of two matchups forces a minimum of two teams.
"""
self.stacks = stacks
self.existing_rosters = existing_rosters or []
Expand Down

0 comments on commit ebbf142

Please sign in to comment.