Skip to content

Commit 7563fe3

Browse files
committed
Stability Only JSON
1 parent 4e70a7f commit 7563fe3

File tree

2 files changed

+55
-7
lines changed

2 files changed

+55
-7
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"0": {
3+
"gcus": [
4+
0.3505995273590088,
5+
0.40213531255722046,
6+
0.3272291123867035,
7+
0.34937676787376404,
8+
0.39807385206222534,
9+
0.3915533423423767,
10+
0.37115952372550964,
11+
0.39112389087677,
12+
0.3972339332103729,
13+
0.3746812343597412,
14+
0.35005295276641846
15+
],
16+
"obj_transfers": [
17+
23.0,
18+
18.0,
19+
21.0,
20+
18.0,
21+
21.0,
22+
17.0,
23+
20.0,
24+
22.0,
25+
21.0,
26+
21.0,
27+
15.0
28+
],
29+
"source_ejections": [
30+
13.0,
31+
11.0,
32+
13.0,
33+
11.0,
34+
12.0,
35+
10.0,
36+
12.0,
37+
13.0,
38+
11.0,
39+
11.0,
40+
10.0
41+
]
42+
},
43+
"mean_gcus": 0.3730199499563737,
44+
"mean_obj_transfers": 19.727272727272727,
45+
"mean_source_ejections": 11.545454545454545
46+
}

scripts/fanwang_bpp/bpp_utils.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,16 @@ def get_action(self, env, obj_indicies, tote_ids, plot=False):
215215
t = time.time()
216216
obj_indicies[env_idx] = [obj for obj in obj_indicies[env_idx] if obj not in self.unpackable_obj_idx]
217217

218-
# Find the object with the largest volume
219-
obj_vols = []
220-
for idx in obj_indicies[env_idx]:
221-
# Get dimensions of the object and compute its volume
222-
obj_vols.append((idx, self.tote_manager.obj_volumes[env_idx, idx].item()))
218+
obj_idx = obj_indicies[env_idx][torch.randint(0, len(obj_indicies[env_idx]), (1,), device=env.unwrapped.device).item()]
219+
220+
# # Find the object with the largest volume
221+
# obj_vols = []
222+
# for idx in obj_indicies[env_idx]:
223+
# # Get dimensions of the object and compute its volume
224+
# obj_vols.append((idx, self.tote_manager.obj_volumes[env_idx, idx].item()))
223225

224-
# Sort by volume (largest first) and get the index
225-
obj_idx = sorted(obj_vols, key=lambda x: x[1], reverse=True)[0][0]
226+
# # Sort by volume (largest first) and get the index
227+
# obj_idx = sorted(obj_vols, key=lambda x: x[1], reverse=True)[0][0]
226228
curr_item = self.problem.items[obj_idx.item()]
227229
obj_idx = obj_idx.unsqueeze(0)
228230
transforms = self.problem.container.search_possible_position(curr_item, step_width=90)

0 commit comments

Comments
 (0)