constraints
constraints
¶
Constraints for squad selection.
SquadQuotas
¶
Position quotas for the 15-player FPL squad.
Rules: - 2 GK, 5 DEF, 5 MID, 3 FWD (exactly). - Total = 15 players.
FormationConstraints
¶
Formation constraints for FPL squad.
Rules: - Exactly 11 players - 1 GK - 3-5 DEF - 2-5 MID - 1-3 FWD
validate
classmethod
¶
validate(players: list[Player]) -> bool
Check if squad satisfies formation constraints.
| PARAMETER | DESCRIPTION |
|---|---|
players
|
List of players in squad
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if valid formation |
Source code in fplx/selection/constraints.py
get_valid_formations
classmethod
¶
Get list of valid formation strings.
| RETURNS | DESCRIPTION |
|---|---|
List[str]
|
Valid formations (e.g., "3-4-3", "4-3-3") |