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

Packing is not optimised #9

Open
chungwong opened this issue Jun 24, 2020 · 0 comments
Open

Packing is not optimised #9

chungwong opened this issue Jun 24, 2020 · 0 comments

Comments

@chungwong
Copy link

There are 28 items and the container "K0004" is able to fit all of them. However, gbp couldn't fit the last item (1000, 1000, 1000, 100), it can only fit 27/28.

The "breaking point" of the last item is (877, 1000, 1000, 100) which if the value of 1000 is changed to 877, it packs all items correctly.

bn <- data.table::data.table(
 id = c("K0001", "K0002", "K0003", "K0004", "K0005"),
 l  = c(06.0000, 10.0000, 09.0000, 1500.0000, 22.0000),
 d  = c(06.0000, 08.0000, 08.0000, 1000.0000, 14.0000),
 h  = c(06.0000, 06.0000, 07.0000, 3200.0000, 09.0000),
 w  = c(600.000, 600.000, 800.000, 12000.000, 800.000)
)

it <- data.table::data.table(
 l   = c(  75, 600, 720, 611, 611,  656,  656, 100, 700,  80,  80,  40,  40,  40,   16,   16,   18, 2500, 700,   75, 100, 720,  55, 750, 535, 100, 700, 1000),
 d   = c( 650, 150, 620,  31,  31,   18,   18, 850, 400, 770, 770, 100, 100, 100, 2500, 2500, 2720,  650, 400,  650, 650, 620, 500,  17, 110, 550, 500, 1000),
 h   = c(1600,  18,  78, 791, 799, 2033, 2033, 750,  50, 850, 850, 165, 165, 165,   11,   11,  160,   30,  50, 1600, 750,  78, 745,  30, 500, 750,  50, 1000),
 w   = c(3500,  14, 130,  99,  99,  143,  143, 250,  60, 150, 150,   1,   1,   1,    4,    4,   48,  210,  60,  350, 220, 130,  90,  26,  35, 200,  75,  100)
)

ldhw <- t(as.matrix(it))

m <- t(as.matrix(bn[ , .(l, d, h, w)])) # multple bin
p <- gbp4d_solver_dpp_prep_create_p(ldhw, m[, 4L]) # single bin
sn4d <- gbp4d_solver_dpp(p, ldhw, m[, 4L])
gbp4d_viewer(sn4d)
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

1 participant