Skip to content

Restrict players from same team #435

@u1tra7

Description

@u1tra7

Any chance we can have a this rule added, where we can specify on optimizer the number of players from the same team, but any team without specifying a position.

the documents have:

Restrict players from same team

In some cases you would want to restrict creating of lineup with players from same team, for example prevent of 2 RB from same team. For this you can use restrict_positions_for_same_team method of optimizer, it takes tuples with 2 positions.

optimizer.restrict_positions_for_same_team(('RB', 'RB'))
optimizer.restrict_positions_for_same_team(('QB', 'DST'), ('RB', 'DST'))

but say in NBA, where we may just want to set a limit per team (not position based, it would be cool to be able to do:

optimizer.set_max_players_from_team(2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions