Created
December 8, 2016 20:45
-
-
Save swanson/2081c9031ac9d5574e4e8d9ec9ae95d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for position, min_limit, max_limit in POSITION_LIMITS: | |
position_cap = solver.Constraint(min_limit, max_limit) | |
for i, player in enumerate(all_players): | |
if position == player.position: | |
position_cap.SetCoefficient(variables[i], 1) | |
# add this section | |
flex_spot = solver.Constraint(1, 1) | |
for i, player in enumerate(all_players): | |
if player.position == "SG" or player.position == "PG": | |
flex_spot.SetCoefficient(variables[i], 1) | |
# and make sure to tweak ROSTER_SIZE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment