plancraft 0.4.5__py3-none-any.whl → 0.4.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plancraft/data/val.repeated.json +60295 -0
- plancraft/environment/planner.py +10 -3
- {plancraft-0.4.5.dist-info → plancraft-0.4.7.dist-info}/METADATA +1 -1
- {plancraft-0.4.5.dist-info → plancraft-0.4.7.dist-info}/RECORD +6 -5
- {plancraft-0.4.5.dist-info → plancraft-0.4.7.dist-info}/WHEEL +0 -0
- {plancraft-0.4.5.dist-info → plancraft-0.4.7.dist-info}/licenses/LICENSE +0 -0
plancraft/environment/planner.py
CHANGED
@@ -392,7 +392,8 @@ def decompose_subgoal(
|
|
392
392
|
|
393
393
|
# if item is already in the correct position, skip
|
394
394
|
if (
|
395
|
-
|
395
|
+
items_to_use_counter[item] > 0
|
396
|
+
and inventory_position in current_inventory
|
396
397
|
and current_inventory[inventory_position]["type"] == item
|
397
398
|
) and current_inventory[inventory_position]["quantity"] > 0:
|
398
399
|
min_quantity_needed.add(inventory_position)
|
@@ -441,6 +442,8 @@ def decompose_subgoal(
|
|
441
442
|
)
|
442
443
|
action_items_used.append(current_inventory[from_slot]["type"])
|
443
444
|
items_to_use_counter[item] -= 1
|
445
|
+
if items_to_use_counter[item] == 0:
|
446
|
+
del items_to_use_counter[item]
|
444
447
|
added_item = True
|
445
448
|
# update state of inventory
|
446
449
|
current_inventory = update_inventory(
|
@@ -496,13 +499,17 @@ def decompose_subgoal(
|
|
496
499
|
return subplan, current_inventory, action_items_used
|
497
500
|
|
498
501
|
|
499
|
-
def get_subplans(
|
502
|
+
def get_subplans(
|
503
|
+
observation: dict, return_items=False
|
504
|
+
) -> tuple[list[list[str]], list, list[str]] | tuple[list[list[str]], list]:
|
500
505
|
current_inventory = copy.deepcopy(observation["inventory"])
|
501
506
|
plan = get_plan(observation)
|
502
507
|
# get action
|
503
508
|
if plan is None or len(plan) == 0:
|
509
|
+
if return_items:
|
510
|
+
return [[str(StopAction())]], [], []
|
504
511
|
return [[str(StopAction())]], []
|
505
|
-
|
512
|
+
|
506
513
|
subplans = []
|
507
514
|
action_items_used = []
|
508
515
|
|
@@ -11,13 +11,14 @@ plancraft/data/test.small.easy.json,sha256=5NZEJ2PqIgmHQecJOIVQyM1D6GFKyJq7GVmgR
|
|
11
11
|
plancraft/data/test.small.json,sha256=eULAG1rdolRMXPrecV-7YoDIheKGyIT5MVpWdISV0wg,270089
|
12
12
|
plancraft/data/train.json,sha256=asZIFnkBdgupPKRXacM4J0Ngt21B2BrMT6oPgFA96HI,2697710
|
13
13
|
plancraft/data/val.json,sha256=IToAiaqUNQi_xhX1bzmInuskLaT7C2ryQjP-CZkzL24,1304403
|
14
|
+
plancraft/data/val.repeated.json,sha256=gLeCg94oB0B_e8QyH8-FBygcJctGA4bkXYldoOHtSfQ,1726468
|
14
15
|
plancraft/data/val.small.easy.json,sha256=9zEmqepjXG2NIp88xnFqOCkwsUsku3HEwHoQGxgTr6U,190252
|
15
16
|
plancraft/data/val.small.json,sha256=76E9EFaljDQyAokg97e-IblvcOe6KbrdKkXvRxhhkgo,237653
|
16
17
|
plancraft/environment/__init__.py,sha256=XFsFny4lH195AwAmL-WeCaF9ZCMgc7IgXIwhQ8FTdgE,505
|
17
18
|
plancraft/environment/actions.py,sha256=Pub21caxM5iZ9IaX-ny1-xxr_peJIwwV_QAx3BVSry0,11551
|
18
19
|
plancraft/environment/env.py,sha256=B7VpIMcQKITyDmkHgBoR4KbmxmM1b4A6Y-1_b90EMXo,16428
|
19
20
|
plancraft/environment/items.py,sha256=Z9rhSyVDEoHF1pxRvhyiT94tyQJaWHi3wUHVcamz82o,221
|
20
|
-
plancraft/environment/planner.py,sha256
|
21
|
+
plancraft/environment/planner.py,sha256=b8p4tH-EyC8v9Rc2wBQr9YJ8AS1dmG0LUBOsoba8Qd8,20695
|
21
22
|
plancraft/environment/prompts.py,sha256=NU9YHAz3id-IgaukQvEi5uLlpEstpE5_Hccvvq1At2Y,6950
|
22
23
|
plancraft/environment/recipes.py,sha256=0vwzOU86eZmGN2EpZVSIvzxpx0AOBWNPxTtAOFBN2A0,19570
|
23
24
|
plancraft/environment/sampler.py,sha256=BworSMWQ-TLbV9068tkNOdo4ZLP-UDox6Laeb4Weu9k,7723
|
@@ -1923,7 +1924,7 @@ plancraft/models/generators.py,sha256=7COMLjjx_HbTWJqINNLqqExQv7gLikfLTViacAdSt5
|
|
1923
1924
|
plancraft/models/oracle.py,sha256=f-0KWlBuHy6wcxmDsxM3MQ_QwfBstzfbA26mlk1MgLA,1657
|
1924
1925
|
plancraft/models/utils.py,sha256=xgkP5jqCeFfkKe3Xd4ZYfTqiEJ-dA-qgFAC-J35ub3E,4029
|
1925
1926
|
plancraft/train/dataset.py,sha256=oFqEd4LG9oEQ-71teh0Wf7-jJbtybT2ZibfM2bBdBkM,5474
|
1926
|
-
plancraft-0.4.
|
1927
|
-
plancraft-0.4.
|
1928
|
-
plancraft-0.4.
|
1929
|
-
plancraft-0.4.
|
1927
|
+
plancraft-0.4.7.dist-info/METADATA,sha256=hSaf9GuTMHGsBRW8wE4svMMIpfmL7yUVCtEFQKgwJw0,12391
|
1928
|
+
plancraft-0.4.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
1929
|
+
plancraft-0.4.7.dist-info/licenses/LICENSE,sha256=YGR8ehDB4t-T-lOQKMfKNR-2zsOU7E3E5NA8t25HKE0,1070
|
1930
|
+
plancraft-0.4.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|