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

Issue with Fiorentina #14

Open
andrekaufman opened this issue Dec 1, 2024 · 3 comments
Open

Issue with Fiorentina #14

andrekaufman opened this issue Dec 1, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@andrekaufman
Copy link

andrekaufman commented Dec 1, 2024

Thanks for your app, super cool! It has worked great for many SBCs, but it doesn't seem to be able to find players from Fiorentina.

When including CLUB = [["Fiorentina"]] I get:

Python main.py
Processing time create_var: 0.05 seconds
Processing time create_basic_constraints: 0.01 seconds
Traceback (most recent call last):
  File "C:\Users\User\Documents\EA-FC-Automated-SBC-Solving-master\main.py", line 64, in <module>
    final_players = optimize.SBC(df)
                    ^^^^^^^^^^^^^^^^
  File "C:\Users\User\Documents\EA-FC-Automated-SBC-Solving-master\optimize.py", line 10, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\Documents\EA-FC-Automated-SBC-Solving-master\optimize.py", line 581, in SBC
    model = create_club_constraint(df, model, player, map_idx, players_grouped, num_cnts)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\Documents\EA-FC-Automated-SBC-Solving-master\optimize.py", line 10, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\Documents\EA-FC-Automated-SBC-Solving-master\optimize.py", line 128, in create_club_constraint
    expr += players_grouped["Club"].get(map_idx["Club"][club], [])
                                        ~~~~~~~~~~~~~~~^^^^^^
KeyError: 'Fiorentina'

When using FIX_PLAYERS, it simply ignores a Fiorentina player. Fixing other players works though.

@Regista6
Copy link
Owner

Regista6 commented Dec 1, 2024

Thank you so much for your interest!

Can you please share your club dataset and the SBC you are trying to solve?

I think the error is because your dataset doesn't have any players from Fiorentina.

@Regista6 Regista6 self-assigned this Dec 1, 2024
@Regista6 Regista6 added the question Further information is requested label Dec 1, 2024
@andrekaufman
Copy link
Author

andrekaufman commented Dec 5, 2024

Sorry for the late reply. I have players from Fiorentina, and I verified that I entered 'Fiorentina' exactly as it was stated in the .csv dataset file exported with FC Enhancer.

The SBC I was trying to solve was this one: https://www.futbin.com/25/squad-building-challenge/ea/565/Fiorentina%20v%20Lombardia%20FC

I ended up solving it by including players from Lombardia FC, but perhaps there's something worth investigating here. My dataset has slightly changed since, but the underlying issue should still persist: https://files.catbox.moe/gm1qh8.csv

Again, I’m blown away by this tool, using CP-SAT solver for SBCs is nuts man! Quick question though: what’s the correct input for "Player Level: Min Silver"?

@Regista6
Copy link
Owner

Regista6 commented Dec 8, 2024

Hi,

Apologies for the late reply. I actually was able to solve the SBC with your squad!

image

Probably there is some issue with the way you are setting the club constraint.

Here are the inputs:

Requirement Input Constraint
# of players from Fiorentina: Min 1
# of players from Lombardia FC: Min 1
CLUB = [["Fiorentina"], ["Lombardia FC"]]
NUM_CLUB = [1,1]
Total players from i^th list >= NUM_CLUB[i]
create_club_constraint
Leagues: Max 4 NUM_UNIQUE_LEAGUE = [4, "Max"]
Leagues: Max / Min / Exactly X
create_unique_league_constraint
Same Club Count: Min 2 MIN_NUM_CLUB = 2
Same Club Count: Min X / Min X Players from the Same Club
create_min_club_constraint
Rare: Min 2 RARITY_2 = ["Rare"]
NUM_RARITY_2 = [2]
Total players from i^th Rarity / Color >= NUM_RARITY_2[i]
create_rarity_2_constraint
Squad Rating: Min 75 SQUAD_RATING = 75 create_squad_rating_constraint_3
Team Chemistry: Min 22 CHEMISTRY = 22
# of players in squad: 11 NUM_PLAYERS = 11

Player Level: Min Silver -> You can uncomment

df = df[df["Color"] != "Bronze"] # Can be used for constraints like Player Quality: Min Silver in preprocess_data_2 in main.py.

Please feel free to reach out if you any other questions!!

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