add_rect() in online packers doesn't return solution
See original GitHub issueI am using the online packer and calling add_rect()
when needed. However, the return value is inconsitent and never complete. The only way to get the full solution seems to be to iterate all bins which is O(n) for n rects packed so far. The solution is available and could be returned, but…
- BBF returns
bool
indicating whether packing succeeded. - BNF and BBF return a rect if successful or
None
otherwise - but not the bin ID it was packed into.
I would suggest changing the return value for all three to a tuple of the form (bin_id, rect)
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:31 (15 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Why uuid4 and not just sequential integer IDs? It’s surely unnecessary to need global unique identifiers, and they’re much more expensive to compute.
Now that i have written it I can’t see many cases where pop(bin_id) would be useful, a simple pop() should be enough and not require an ordereddict