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

Predefined positions set by the user #97

Closed
dazito opened this issue Mar 23, 2019 · 5 comments
Closed

Predefined positions set by the user #97

dazito opened this issue Mar 23, 2019 · 5 comments

Comments

@dazito
Copy link
Contributor

dazito commented Mar 23, 2019

A nice feature is to allow some boxes to be positioned beforehand in some specific places (pre defined by the user) and then pack the remaining boxes in the remaining free spaces.

Example,

  • We have a container 50x50x50
  • We specify that in position (x,y,z) 10, 0, 10 we already have a box with dimension 5, 5, 5
  • We have 2 boxes to be packed with dimensions 10, 10, 10 and 15, 15, 15
  • Now we ask the library to pack the two boxes above but to take in consideration that position 10, 0, 10 is already occupied with a box with dimension 5, 5, 5 and therefore to not place these two boxes there.

Did I make myself clear?

@skjolber
Copy link
Owner

Yes. This might be incorporated into the 'free space' calculations somehow.

@dazito
Copy link
Contributor Author

dazito commented May 28, 2019

I was debugging this part of the code to fully understand the logic and I have a few questions regarding getFreespaces method.

  1. The variable used, of type Box, is the box we want to place inside the container, right?
  2. The output Space[] freeSpaces is a pair of coordinates representing two free areas where one pair member is the "starting" coordinate and the other the "end" coordinate, correct?
  3. Would it make sense if we pass in to getFreespaces another parameter (a list of Boxes) representing the user defined occupied spaces and then let the getFreespaces calculate the free spaces left? But this time there may be more than 2 free spaces as seen below, right?
+-------------+----------------X----------------------+
|             |                X                      |
|             |                X                      |
|      A      |                X         3            |
|             |                X                      |
|             |                X                      |
|             |                X                      |
X-------------X                X-----------XXXXXXXXXXXX
X             X                |           |          |
X             X                |           |          |
X             X        2       |     B     |    5     |
X             X                |           |          |
X      1      X                |           |          |
X             X                |           |          |
X             X                X-----------XXXXXXXXXXXX
X             X                X                      |
X             X                X                      |
X             X                X           4          |
X             X                X                      |
X             X                X                      |
XXXXXXXXXXXXXXX----------------X----------------------+

A => Box to be placed
B => Locked space - the user set this area as not free

1, 2, 3, 4 and 5 are a possible set of free spaces

@skjolber
Copy link
Owner

skjolber commented Jun 6, 2019

1 & 2: Yes
3: I think this would solve this issue

@skjolber
Copy link
Owner

@dazito this can work in the new version 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants