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

KeyError: 'o_0' in baselin.py #6

Open
jonas-morsch opened this issue Dec 14, 2022 · 3 comments
Open

KeyError: 'o_0' in baselin.py #6

jonas-morsch opened this issue Dec 14, 2022 · 3 comments

Comments

@jonas-morsch
Copy link

got a Keyerror when using the baseline algorithm

File c:\Users\g7morsj22l\Documents\02_Code_Repos\3d-bpp\src\baseline.py:174, in baseline(superitems_pool, pallet_dims, tlim, num_workers)
    172 layer_pool = layers.LayerPool(superitems_pool, pallet_dims)
    173 for l in range(max_layers):
--> 174     if sol[f"o_{l}"] > 0:
    175         superitems_in_layer = [s for s in range(n_superitems) if sol[f"z_{s}_{l}"] == 1]
    176         layer = utils.build_layer_from_model_output(
    177             superitems_pool, superitems_in_layer, sol, pallet_dims
@Wadaboa
Copy link
Owner

Wadaboa commented Jan 8, 2023

Hi there,

Could you provide more information as to how to reproduce the error, the full exception traceback and your local environment?

Thanks,
Alessio.

@qiyuan-xinlan
Copy link

I also encountered this problem, which should be related to the parameters of the CpSolver parameters. The 20-second time might be too short. When I set 'tlim' to None, the program ran for more than 40 minutes without producing any results. However, after commenting out lines 130,131, 132 in baseline.py, I reran the program, and it completed in 2 minutes and produced the results.

@Wadaboa
Copy link
Owner

Wadaboa commented Jul 21, 2023

Interesting, thanks for sharing your solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants