Skip to content

Instantly share code, notes, and snippets.

@sertalpbilal
Created August 9, 2021 13:26
Show Gist options
  • Save sertalpbilal/f5708b4123266e13eb97130e04c14670 to your computer and use it in GitHub Desktop.
Save sertalpbilal/f5708b4123266e13eb97130e04c14670 to your computer and use it in GitHub Desktop.
Punt length constraint
if punt_length is not None:
punt_length = int(punt_length)
final_gw = gameweeks[-1]
model.add_constraints((so.expr_sum(transfer_out[p,w2] for w2 in range(w, w+punt_length)) <= 1-transfer_in[p,w] for p in players for w in gameweeks if w <= final_gw-punt_length+1), name='f_punt_length')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment