JamesBremner / knapsack

3D Bin packing code direct from psuedocode
3 stars 1 forks source link

Cut list errors #9

Closed JamesBremner closed 4 years ago

JamesBremner commented 4 years ago

This input

i 1000 600 200 1 i1
d 500 300 200 4 o1

outputs this cutlist

c i1 L 0 0
c i1 L 500 0
c i1 W 600 0
c i1 L 1000 0

The cuts at the stock edges should be suppressed, and the W cut should be at 300, not 600.

JamesBremner commented 4 years ago
C:\Users\James\code\knapsack\bin>timberAllocation.exe ../data/t3.txt
TimberAllocation
level 200 ( o1 o1:2 o1:3 o1:4 )
level 200 order count 4 allocated stock 1000 600 200 i1
cutting level level 200 ( o1 o1:2 o1:3 o1:4 ) stock i1
packing o1 into i1
packing o1:2 into i1
packing o1:3 into i1
packing o1:4 into i1
all timbers in this level are packed
a i1 o1
a i1 o1:2
a i1 o1:3
a i1 o1:4
c i1 W 300 0
c i1 L 500 0
JamesBremner commented 4 years ago

Passes unit test https://github.com/JamesBremner/knapsack/blob/master/src/taUnitTest.cpp