This solver fails to align one of the blocks in the second training example, as pictured below:
Expected result:
Solver's result:
I believe the issue is as follows. The solver uses a scoring function to find the best alignment for each block, which I believe is calculated as: 10 x (intersection with whole canvas) - 10 x (intersection with red tiles) - 8 x (negative space in block's rect that isn't covered by red tiles) - 8 x (distance from tile to top of canvas) - (number of tiles in outbox that are not red). Both the expected and actual results get the same score of 17.
Expected: 10 x 3 - 10 x 0 - 8 x 0 - 8 x 1 - 5 = 30 - 8 - 5 = 17.
Solver's result: 10 x 3 - 10 x 1 - 8 x 0 - 8 x 0 - 3 = 30 - 10 - 3 = 17.
This can be solved by changing the weights in the scoring function. I replaced EIGHT with FIVE and this seemed to fix the issue without changing any other solutions; the score for the correct arrangement becomes 20 while the incorrect arrangement still gets a score of 17.
This solver fails to align one of the blocks in the second training example, as pictured below:
Expected result:
Solver's result:
I believe the issue is as follows. The solver uses a scoring function to find the best alignment for each block, which I believe is calculated as: 10 x (intersection with whole canvas) - 10 x (intersection with red tiles) - 8 x (negative space in block's rect that isn't covered by red tiles) - 8 x (distance from tile to top of canvas) - (number of tiles in outbox that are not red). Both the expected and actual results get the same score of 17.
This can be solved by changing the weights in the scoring function. I replaced
EIGHT
withFIVE
and this seemed to fix the issue without changing any other solutions; the score for the correct arrangement becomes 20 while the incorrect arrangement still gets a score of 17.