rectangle-packing-solver icon indicating copy to clipboard operation
rectangle-packing-solver copied to clipboard

Getting Wrong Result

Open arncode90 opened this issue 3 years ago • 1 comments

Hello there, actually i like your packing solver because it came out with visualization.

The issue here im getting wrong placement of the result (or im just using wrong code i dont know).

problem = rps.Problem(rectangles=[
    {"width": 30, "height": 60, "rotatable": True},
    {"width": 30, "height": 50, "rotatable": True}
])
solution = rps.Solver().solve(problem=problem, width_limit=60, show_progress=True, seed=1111)
print("solution:", solution)

###
solution: Solution({'sequence_pair': SequencePair(([0, 1], [1, 0])), 'floorplan': Floorplan({'positions': [{'id': 0, 'x': 0, 'y': 50, 'width': 30, 'height': 60}, {'id': 1, 'x': 0, 'y': 0, 'width': 30, 'height': 50}], 'bounding_box': (30, 110), 'area': 3300})})

for the bounding box, it should be this right ?

'bounding_box': (60, 60)

arncode90 avatar Mar 09 '22 17:03 arncode90

@catherinezera88 Hi! Thank you for reporting the issue. I reproduce the same issue in my environment, and it seems a bug in the solver. Yes, it should be (60, 60). I'll try to fix it.

kotarot avatar Mar 12 '22 12:03 kotarot