Open wizardous23 opened 3 years ago
group = PlayersGroup([optimizer.get_player_by_name(name) for name in ('Donovan Mitchell', 'Giannis Antetokoumpo')]) optimizer.add_players_group(group)
group = PlayersGroup([optimizer.get_player_by_name(name) for name in ('Donovan Mitchell', 'Giannis Antetokoumpo')]) optimizer.add_players_group(group)
This gives me 100% exposure to each player which isn't what I want. I just want every lineup that has Player A to have Player B. Any way to do this?
Use
teams = ['GS', 'MEM']
optimizer.add_players_group(PlayersGroup(players=[player for player in optimizer.players if player.team in teams], min_from_group=7, max_from_group=7))
Just set teams and min and max
Hope thats what your looking for. If you want certain positions i can try to help
@Denwen12 How would you force a minimum of 1 of ANY player from MIL, AND UTA into every lineup in the example above? lineup 1 have Giannis and Mitchell lineup 2 have Middleton and Mitchell lineup 3 have Giannis and Conley, etc?
Is there any way I could stack players in 1 game. For example if I wanted to stack the Milwaukee vs Utah game is there a way I could have the optimizer force every lineup that has Donovan Mitchell to have Giannis Antetokoumpo?