Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understanding the input #6

Open
Pegi491 opened this issue Oct 24, 2023 · 1 comment
Open

Understanding the input #6

Pegi491 opened this issue Oct 24, 2023 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@Pegi491
Copy link

Pegi491 commented Oct 24, 2023

Hi, I was checking the project and was very hyped for the solver. Good job on the programming!! I'm just having trouble to understand the parameters for the sbc. could u provide any better info how to setup the input?

Sorry for my english.

@Regista6
Copy link
Owner

Regista6 commented Oct 24, 2023

My workflow is like this:

  1. First in main.py, I set the name of my club after downloading the club.csv using the chrome extension. After that in preprocess_data_2, I comment/uncomment the appropriate filters. You can even add custom filters like excluding certain players. Some of the filters are necessary, especially the ones on cost != '-- NA --' and loan_players.

  2. Currently the inputs are set to solve this SBC. The main constraints are in optimize.py (L552-588) and the inputs for each constraint are in input.py. So you will have to plug in the inputs for the SBC first in input.py and enable the appropriate constraint by uncommenting the line in optimize.py. Comment out the constraints not required for the SBC.

For this SBC, I've done the following.
3. (a) In input.py, set Formation = 4-2-2-2 and USE_ALTERNATE_POSITIONS = True. There are no duplicates in my dataset. If duplicates were to be prioritized, set any one of the 3 options True and then uncomment model = prioritize_duplicates(df, model, player) in optimize.py.

(b) NUM_UNIQUE_LEAGUE = [4, "Exactly"] # Leagues: Max / Min / Exactly X and then enable model = create_unique_league_constraint(df, model, player, league, map_idx, players_grouped, num_cnts). This handles Leagues: Exactly 4. Similar logic will apply to the requirement Nationalities: Exactly 5.

(c) MAX_NUM_LEAGUE = 4 # Same League Count: Max X and then enable model = create_max_league_constraint(df, model, player, map_idx, players_grouped, num_cnts). This handles Same League Count: Max 4 and the same logic will apply for the requirement Same Nation Count: Max 3.

(d) SQUAD_RATING = 80 # Squad Rating: Min XX and then enable model = create_squad_rating_constraint_3(df, model, player, map_idx, players_grouped, num_cnts) in optimize.py.

(e) CHEMISTRY = 25 # Squad Total Chemistry Points: Min X. If there are no requirements on chemistry, simply set this to 0.

You can refer to the comments under each function to know which input maps to which constraint. Thanks for using the repo, let me know if you have any more questions or if there is a particular SBC you want to solve 🙏 .

@Regista6 Regista6 self-assigned this Oct 24, 2023
@Regista6 Regista6 added the question Further information is requested label Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants