Closed Jackson-Crandell closed 1 year ago
Hello, thank you very much for your attention and your feedback on the code. This project did some refactorings when it was released, in order to make it easier for users to read and use, but at present, these refactorings seem to have introduced some new questions. I'll double-check these when I have some spare time.
Regarding the 'break' you mentioned on lines 160 and 164, it was originally designed to be like this: when the algorithm reads the X and Y directions of the current box placed in the given pose. We need to determine the last dimension of the box, the size of the Z direction, so we need to compare it with the initial box size recorded in the environment.
For example, the initial pose of the box is [0.2, 0.3, 0.4], and in the action given by RL, after the box is rotated, the occupancy in the X and Y directions is 0.3 and 0.4. Then we need to firstly remove 0.3 from [0.2,0.3,0.4] according to X=0.3, and similarly, we remove 0.4 from [0.2,0.3,0.4] according to Y = 0.4, and then we know that the height of the box in the Z direction is now 0.2.
This is the logic of this part of the code, if you remove the two breakpoints, I think this may cause a series of problems, I suggest you use matplotlib to visualize your results and see if the placement results are correct.
Also, I don't know if I understood you correctly, if you mean, given the same finite number of boxes, their packing performance should be the same in continuous and discrete environments. However, if you mean that the test box is sampled in the same size interval, then the performance of RL in the continuous domain is unlikely to be close to the performance in the discrete domain. Because sampling in the continuous domain will generate more kinds of boxes, which increases this difficulty of the problem.
I hope my answer helps you, best wishes! ^_^
I apologize for my delayed response. I finally had a chance to look at this again. I do understand the purpose of the break statements. I didn't mean to imply you should delete them, but they need to be moved to the right (see code below) such that they fall within the scope of the 'if' clause. Otherwise, the loop will immediately break and the boxes will be assigned the wrong dimension.
for r in record:
if abs(x - self.next_box[r]) < 1e-6:
record.remove(r)
break (move break here)
for r in record:
if abs(y - self.next_box[r]) < 1e-6:
record.remove(r)
break (move break here)
z = self.next_box[record[0]]
Ignore the title of this issue, I really just wanted to point out this issue above ^. Thank you for your prompt response! :)
Hi, excellent work on your paper and thank you so much for sharing your code! This is fascinating research! I wanted to explore your work more through the code, but I was struggling to achieve the same performance in the discrete environment and the continuous environment. I think the error is lines 160 and 164 in PCTContinuous0/bin3D.py. The break statements should be indented. This gives me the same performance between discrete and continuous :)