fixing crafting tasks as well

This commit is contained in:
Isadora White 2025-05-12 19:46:49 -07:00
parent 015d38ab69
commit c1d106de0f
14 changed files with 3439 additions and 6781 deletions

Binary file not shown.

View file

@ -183,9 +183,6 @@ def extract_success_scores(folders, model_names):
display_table("Average Success Score by Room", avg_room_scores)
display_table("Average Success Score by (Material, Room) Tuples", avg_material_room_scores, tuple_keys=True)
def analyze_construction_log(log_file):
# ... existing code ...
pass
def main():
parser = argparse.ArgumentParser(description='Analyze construction task logs.')

View file

@ -2,6 +2,7 @@ import random
import json
from typing import Dict, List, Any, Tuple, Set
from collections import Counter, defaultdict
import itertools
# Define your COOKING_ITEMS dictionary here
# This is where you should put your complete COOKING_ITEMS dictionary
@ -325,10 +326,10 @@ def generate_hells_kitchen_task_id(task: Dict[str, Any]) -> str:
# Combine everything with hells_kitchen suffix
return f"multiagent_cooking_{quantities}_hells_kitchen"
def generate_hells_kitchen_task() -> Dict[str, Any]:
def generate_hells_kitchen_task(selected_items) -> Dict[str, Any]:
"""Generate a single Hell's Kitchen task where agents have recipes for each other's items."""
# Select two different items
selected_items = random.sample(list(COOKING_ITEMS.keys()), 2)
# selected_items = random.sample(list(COOKING_ITEMS.keys()), 2)
# Assign one item to each agent
agent0_target = selected_items[0]
@ -458,16 +459,22 @@ def generate_maximum_hells_kitchen_tasks(
all_items = list(COOKING_ITEMS.keys())
# Fixed test items as specified in your original code
hk_test_items = {"cooked_mutton", "baked_potato", "cake", "golden_carrot", "mushroom_stew", "bread"}
hk_test_items = {"cooked_beef", "baked_potato", "cake", "golden_apple", "rabbit_stew", "bread"}
hk_train_items = set(all_items) - hk_test_items
hk_test_lst = list(hk_test_items)
train_possible_combinations = itertools.combinations(hk_train_items, 2)
test_possible_combinations = [["bread", "golden_apple"], ["golden_apple", "rabbit_stew"], ["bread", "cake"],
["baked_potato", "golden_apple"], ["baked_potato", "cake"], ["cooked_beef", "golden_apple"]]
# test_possible_combinations = itertools.combinations(hk_test_lst, 2)
# Set fixed seed for consistent results
random.seed(42)
# Generate tasks for training set
train_tasks = {}
while len(train_tasks) < num_train_tasks:
task = generate_hells_kitchen_task()
for combination in train_possible_combinations:
task = generate_hells_kitchen_task(combination)
task_id, task_data = list(task.items())[0]
# Check if task uses valid items for train set
@ -480,8 +487,8 @@ def generate_maximum_hells_kitchen_tasks(
# Generate tasks for test set
test_tasks = {}
while len(test_tasks) < num_test_tasks:
task = generate_hells_kitchen_task()
for combination in test_possible_combinations:
task = generate_hells_kitchen_task(combination)
task_id, task_data = list(task.items())[0]
# Check if task uses valid items for test set
@ -594,7 +601,7 @@ if __name__ == "__main__":
with open("hells_kitchen_train_tasks.json", "w") as f:
json.dump(hk_train_tasks, f, indent=2)
with open("hells_kitchen_test_tasks.json", "w") as f:
with open("mindcraft/tasks/cooking_tasks/require_collab_test_2_items/2_agent_hells_kitchen.json", "w") as f:
json.dump(hk_test_tasks, f, indent=2)
# Print counts

View file

@ -4,6 +4,7 @@ from typing import Dict, List, Any, Tuple, Set
from collections import Counter, defaultdict
import os
import numpy as np
import itertools
# Define your COOKING_ITEMS dictionary here
# This is where you should put your complete COOKING_ITEMS dictionary
@ -245,6 +246,38 @@ chest_items = {
"iron_ingot": 64,
}
def make_initial_inventory(items, num_agents):
"""
Evenly split inventory between the agents for a given set of items and number of agents
"""
inventory = {}
for item in items:
if item in COOKING_ITEMS:
cooking_info = COOKING_ITEMS[item]
for chest_item, quantity in cooking_info.get("required_chest_items", {}).items():
inventory[chest_item] = inventory.get(chest_item, 0) + quantity
else:
print(f"item {item} not found in COOKING_ITEMS.")
initial_inventory = {}
for i in range(num_agents):
initial_inventory[i] = {}
items_lst = list(inventory.keys())
for i in range(len(items_lst)):
item_counts = count_items_in_inventory(initial_inventory)
agent_num = np.argmin(item_counts)
if inventory[items_lst[i]] == 1:
initial_inventory[agent_num][items_lst[i]] = 1
elif inventory[items_lst[i]] > 1:
div = inventory[items_lst[i]] // num_agents
rem = inventory[items_lst[i]] % num_agents
for j in range(num_agents):
initial_inventory[j][items_lst[i]] = div
j = 0
while j < rem:
initial_inventory[j][items_lst[i]] += 1
j += 1
return initial_inventory
def count_items_in_inventory(inventory):
item_counts = []
for key in inventory.keys():
@ -255,6 +288,50 @@ def count_items_in_inventory(inventory):
item_counts.append(total_items)
return item_counts
def make_all_possible_tasks(items: List[str], num_items:int, num_agents: int, output_file) -> List[Dict[str, Any]]:
combinations = itertools.combinations(items, num_items)
tasks = {}
for combination in combinations:
task = {}
task["type"] = "cooking"
task["recipes"] = {}
task["agent_count"] = num_agents
task["target"] = {}
for item in combination:
task["target"][item] = 1
for item in combination:
if item in COOKING_ITEMS:
task["recipes"][item] = COOKING_ITEMS[item]["recipe"]
else:
print(f"item {item} not found in COOKING_ITEMS.")
initial_inventory = make_initial_inventory(combination, num_agents)
task["initial_inventory"] = initial_inventory
task["goal"] = {}
goal_str = f"Collaborate with other agents around you to make "
conversation_str = f"Let's collaborate to make "
for item in combination:
goal_str += item + ", "
conversation_str += item + ", "
recipe_goal_str = goal_str + "The recipes are as follows:\n"
for item in combination:
recipe_goal_str += f"Recipe for {item}:\n{COOKING_ITEMS[item]['recipe']}\n"
for i in range(num_agents):
task["goal"][i] = recipe_goal_str
task["conversation"] = conversation_str
partial_plan_task = task.copy()
partial_plan_task["goal"] = {}
for i in range(num_agents):
partial_plan_task["goal"][i] = goal_str
recipe_goal_str = goal_str
partial_plan_task["goal"][0] = recipe_goal_str
task_id = "multiagent_cooking"
for item in combination:
task_id += "_" + item
tasks[task_id] = task
tasks[task_id + "_partial_plan"] = partial_plan_task
with open(output_file, 'w') as f:
json.dump(tasks, f, indent=4)
def reconfigure_tasks(task_path, new_task_path, num_agents=None, hells_kitchen=False):
@ -343,10 +420,13 @@ def reconfigure_tasks(task_path, new_task_path, num_agents=None, hells_kitchen=F
# reconfigure_tasks("mindcraft/tasks/cooking_tasks/test_tasks/2_agent_cooking_test_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_test_2_items/3_agent.json", 3)
# reconfigure_tasks("mindcraft/tasks/cooking_tasks/test_tasks/2_agent_cooking_test_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_test_2_items/4_agent.json", 4)
# reconfigure_tasks("mindcraft/tasks/cooking_tasks/test_tasks/2_agent_cooking_test_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_test_2_items/5_agent.json", 5)
reconfigure_tasks("mindcraft/tasks/cooking_tasks/test_tasks/test_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_test_2_items/2_agent_block_recipe.json", 2)
reconfigure_tasks("mindcraft/tasks/cooking_tasks/test_tasks/hells_kitchen_test_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_test_2_items/2_agent_hells_kitchen.json", 2, True)
reconfigure_tasks("mindcraft/tasks/cooking_tasks/train_tasks/train_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_train_2_items/2_agent_block_recipe.json", 2, False)
reconfigure_tasks("mindcraft/tasks/cooking_tasks/train_tasks/hells_kitchen_train_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_train_2_items/2_agent_hells_kitchen.json", 2, True)
test_items = ["bread", "golden_apple", "rabbit_stew", "cake", "baked_potato", "cooked_beef"]
make_all_possible_tasks(test_items, 2, 2, "mindcraft/tasks/cooking_tasks/require_collab_test_2_items/2_agent_all_possible.json")
# reconfigure_tasks("mindcraft/tasks/cooking_tasks/test_tasks/test_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_test_2_items/2_agent_block_recipe.json", 2)
# reconfigure_tasks("mindcraft/tasks/cooking_tasks/test_tasks/hells_kitchen_test_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_test_2_items/2_agent_hells_kitchen.json", 2, True)
# reconfigure_tasks("mindcraft/tasks/cooking_tasks/train_tasks/train_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_train_2_items/2_agent_block_recipe.json", 2, False)
# reconfigure_tasks("mindcraft/tasks/cooking_tasks/train_tasks/hells_kitchen_train_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_train_2_items/2_agent_hells_kitchen.json", 2, True)
# reconfigure_tasks("mindcraft/tasks/cooking_tasks/train_tasks/2_agent_cooking_train_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_train_2_items/3_agent.json", 3)
# reconfigure_tasks("mindcraft/tasks/cooking_tasks/train_tasks/2_agent_cooking_train_tasks.json", "mindcraft/tasks/cooking_tasks/require_collab_train_2_items/4_agent.json", 4)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,153 @@
{
"multiagent_cooking_2_1_baked_potato_1_golden_apple": {
"conversation": "Let's work together to make baked_potato, golden_apple.",
"agent_count": 5,
"target": {
"baked_potato": 1,
"golden_apple": 1
},
"type": "cooking",
"timeout": 500,
"recipes": {
"baked_potato": [
"Step 1: Go to the farm and collect 1 potato (search for 'potatoes' (not 'potato')).",
"Step 2: Get coal from your inventory or other agents.",
"Step 3: Put coal in the furnace",
"Step 2: Go to the furnace and bake the potato."
],
"golden_apple": [
"Step 1: Get 1 apple and 8 gold ingots from your inventory or other bots.",
"Step 2: Go to the crafting table and surround the apple with the gold ingots to create a golden apple."
]
},
"blocked_access_to_recipe": [],
"goal": {
"0": "Collaborate with agents around you to make 1 baked_potato, 1 golden_apple. Recipe for baked_potato:\n[\"Step 1: Go to the farm and collect 1 potato (search for 'potatoes' (not 'potato')).\", 'Step 2: Get coal from your inventory or other agents.', 'Step 3: Put coal in the furnace', 'Step 2: Go to the furnace and bake the potato.']Recipe for golden_apple:\n['Step 1: Get 1 apple and 8 gold ingots from your inventory or other bots.', 'Step 2: Go to the crafting table and surround the apple with the gold ingots to create a golden apple.']",
"1": "Collaborate with agents around you to make 1 baked_potato, 1 golden_apple. Recipe for baked_potato:\n[\"Step 1: Go to the farm and collect 1 potato (search for 'potatoes' (not 'potato')).\", 'Step 2: Get coal from your inventory or other agents.', 'Step 3: Put coal in the furnace', 'Step 2: Go to the furnace and bake the potato.']Recipe for golden_apple:\n['Step 1: Get 1 apple and 8 gold ingots from your inventory or other bots.', 'Step 2: Go to the crafting table and surround the apple with the gold ingots to create a golden apple.']"
},
"initial_inventory": {
"0": {
"coal": 2,
"gold_ingot": 2
},
"1": {
"coal": 2,
"gold_ingot": 2
},
"2": {
"coal": 2,
"gold_ingot": 2
},
"3": {
"coal": 2,
"gold_ingot": 2
},
"4": {
"coal": 2,
"apple": 1
}
}
},
"multiagent_cooking_2_1_baked_potato_1_cake": {
"conversation": "Let's work together to make baked_potato, cake.",
"agent_count": 5,
"target": {
"baked_potato": 1,
"cake": 1
},
"type": "cooking",
"timeout": 500,
"recipes": {
"baked_potato": [
"Step 1: Go to the farm and collect 1 potato (search for 'potatoes' (not 'potato')).",
"Step 2: Get coal from your inventory or other agents.",
"Step 3: Put coal in the furnace",
"Step 2: Go to the furnace and bake the potato."
],
"cake": [
"Step 1: Go to the farm and collect 3 wheat, 2 sugar cane.",
"Step 2: From your inventory or other agents get 3 milk buckets (already filled with milk).",
"Step 3: Get an egg from your inventory or other agents.",
"Step 4: Go to the crafting table and craft the sugarcane into sugar.",
"Step 5: Go to the crafting table and combine all ingredients (3 wheat, 2 sugar, 1 egg, and milk bucket) to make a cake."
]
},
"blocked_access_to_recipe": [],
"goal": {
"0": "Collaborate with agents around you to make 1 baked_potato, 1 cake. Recipe for baked_potato:\n[\"Step 1: Go to the farm and collect 1 potato (search for 'potatoes' (not 'potato')).\", 'Step 2: Get coal from your inventory or other agents.', 'Step 3: Put coal in the furnace', 'Step 2: Go to the furnace and bake the potato.']Recipe for cake:\n['Step 1: Go to the farm and collect 3 wheat, 2 sugar cane.', 'Step 2: From your inventory or other agents get 3 milk buckets (already filled with milk).', 'Step 3: Get an egg from your inventory or other agents.', 'Step 4: Go to the crafting table and craft the sugarcane into sugar.', 'Step 5: Go to the crafting table and combine all ingredients (3 wheat, 2 sugar, 1 egg, and milk bucket) to make a cake.']",
"1": "Collaborate with agents around you to make 1 baked_potato, 1 cake. Recipe for baked_potato:\n[\"Step 1: Go to the farm and collect 1 potato (search for 'potatoes' (not 'potato')).\", 'Step 2: Get coal from your inventory or other agents.', 'Step 3: Put coal in the furnace', 'Step 2: Go to the furnace and bake the potato.']Recipe for cake:\n['Step 1: Go to the farm and collect 3 wheat, 2 sugar cane.', 'Step 2: From your inventory or other agents get 3 milk buckets (already filled with milk).', 'Step 3: Get an egg from your inventory or other agents.', 'Step 4: Go to the crafting table and craft the sugarcane into sugar.', 'Step 5: Go to the crafting table and combine all ingredients (3 wheat, 2 sugar, 1 egg, and milk bucket) to make a cake.']"
},
"initial_inventory": {
"0": {
"coal": 2,
"milk_bucket": 1
},
"1": {
"coal": 2,
"milk_bucket": 1
},
"2": {
"coal": 2,
"milk_bucket": 1
},
"3": {
"coal": 2,
"egg": 1
},
"4": {
"coal": 2,
"egg": 1
}
}
},
"multiagent_cooking_2_1_cooked_beef_1_golden_apple": {
"conversation": "Let's work together to make golden_apple, cooked_beef.",
"agent_count": 5,
"target": {
"golden_apple": 1,
"cooked_beef": 1
},
"type": "cooking",
"timeout": 500,
"recipes": {
"golden_apple": [
"Step 1: Get 1 apple and 8 gold ingots from your inventory or other bots.",
"Step 2: Go to the crafting table and surround the apple with the gold ingots to create a golden apple."
],
"cooked_beef": [
"Step 1: Kill a cow and pick up 1 beef that is dropped.",
"Step 2: Get coal from your inventory or other agents.",
"Step 3: Put coal in the furnace",
"Step 4: Go to furnace and use it to cook the beef."
]
},
"blocked_access_to_recipe": [],
"goal": {
"0": "Collaborate with agents around you to make 1 golden_apple, 1 cooked_beef. Recipe for golden_apple:\n['Step 1: Get 1 apple and 8 gold ingots from your inventory or other bots.', 'Step 2: Go to the crafting table and surround the apple with the gold ingots to create a golden apple.']Recipe for cooked_beef:\n['Step 1: Kill a cow and pick up 1 beef that is dropped.', 'Step 2: Get coal from your inventory or other agents.', 'Step 3: Put coal in the furnace', 'Step 4: Go to furnace and use it to cook the beef.']",
"1": "Collaborate with agents around you to make 1 golden_apple, 1 cooked_beef. Recipe for golden_apple:\n['Step 1: Get 1 apple and 8 gold ingots from your inventory or other bots.', 'Step 2: Go to the crafting table and surround the apple with the gold ingots to create a golden apple.']Recipe for cooked_beef:\n['Step 1: Kill a cow and pick up 1 beef that is dropped.', 'Step 2: Get coal from your inventory or other agents.', 'Step 3: Put coal in the furnace', 'Step 4: Go to furnace and use it to cook the beef.']"
},
"initial_inventory": {
"0": {
"gold_ingot": 2,
"coal": 2
},
"1": {
"gold_ingot": 2,
"coal": 2
},
"2": {
"gold_ingot": 2,
"coal": 2
},
"3": {
"gold_ingot": 2,
"coal": 2
},
"4": {
"apple": 1,
"coal": 2
}
}
}
}

View file

@ -0,0 +1,185 @@
{
"multiagent_cooking_2_1_golden_carrot_1_pumpkin_pie": {
"conversation": "Let's work together to make pumpkin_pie, golden_carrot.",
"agent_count": 5,
"target": {
"pumpkin_pie": 1,
"golden_carrot": 1
},
"type": "cooking",
"timeout": 500,
"recipes": {
"pumpkin_pie": [
"Step 1: Go to the farm and collect 1 pumpkin and 1 sugar cane.",
"Step 2: Get 1 egg from your inventory or other bots",
"Step 3: Go to the crafting table and craft the sugar cane into sugar.",
"Step 4: Go to the crafting table and combine the pumpkin, egg, and sugar to make a pumpkin pie."
],
"golden_carrot": [
"Step 1: Go to the farm and collect 1 carrot.",
"Step 2: Go to the chest and collect gold ingots and convert them to gold nuggets.",
"Step 3: Go to the crafting table and surround the carrot with gold nuggets to create a golden carrot."
]
},
"blocked_access_to_recipe": [],
"goal": {
"0": "Collaborate with agents around you to make 1 pumpkin_pie, 1 golden_carrot. Recipe for pumpkin_pie:\n['Step 1: Go to the farm and collect 1 pumpkin and 1 sugar cane.', 'Step 2: Get 1 egg from your inventory or other bots', 'Step 3: Go to the crafting table and craft the sugar cane into sugar.', 'Step 4: Go to the crafting table and combine the pumpkin, egg, and sugar to make a pumpkin pie.']Recipe for golden_carrot:\n['Step 1: Go to the farm and collect 1 carrot.', 'Step 2: Go to the chest and collect gold ingots and convert them to gold nuggets.', 'Step 3: Go to the crafting table and surround the carrot with gold nuggets to create a golden carrot.']",
"1": "Collaborate with agents around you to make 1 pumpkin_pie, 1 golden_carrot. Recipe for pumpkin_pie:\n['Step 1: Go to the farm and collect 1 pumpkin and 1 sugar cane.', 'Step 2: Get 1 egg from your inventory or other bots', 'Step 3: Go to the crafting table and craft the sugar cane into sugar.', 'Step 4: Go to the crafting table and combine the pumpkin, egg, and sugar to make a pumpkin pie.']Recipe for golden_carrot:\n['Step 1: Go to the farm and collect 1 carrot.', 'Step 2: Go to the chest and collect gold ingots and convert them to gold nuggets.', 'Step 3: Go to the crafting table and surround the carrot with gold nuggets to create a golden carrot.']"
},
"initial_inventory": {
"0": {
"egg": 1,
"gold_ingot": 2
},
"1": {
"gold_ingot": 2
},
"2": {
"gold_ingot": 2
},
"3": {
"gold_ingot": 1
},
"4": {
"gold_ingot": 1
}
}
},
"multiagent_cooking_2_1_cooked_porkchop_1_golden_carrot": {
"conversation": "Let's work together to make cooked_porkchop, golden_carrot.",
"agent_count": 5,
"target": {
"cooked_porkchop": 1,
"golden_carrot": 1
},
"type": "cooking",
"timeout": 500,
"recipes": {
"cooked_porkchop": [
"Step 1: Kill a pig and pick up 1 porkchop that is dropped.",
"Step 2: Get coal from your inventory or other agents.",
"Step 3: Put coal in the furnace",
"Step 4: Go to furnace and use it to cook the porkchop."
],
"golden_carrot": [
"Step 1: Go to the farm and collect 1 carrot.",
"Step 2: Go to the chest and collect gold ingots and convert them to gold nuggets.",
"Step 3: Go to the crafting table and surround the carrot with gold nuggets to create a golden carrot."
]
},
"blocked_access_to_recipe": [],
"goal": {
"0": "Collaborate with agents around you to make 1 cooked_porkchop, 1 golden_carrot. Recipe for cooked_porkchop:\n['Step 1: Kill a pig and pick up 1 porkchop that is dropped.', 'Step 2: Get coal from your inventory or other agents.', 'Step 3: Put coal in the furnace', 'Step 4: Go to furnace and use it to cook the porkchop.']Recipe for golden_carrot:\n['Step 1: Go to the farm and collect 1 carrot.', 'Step 2: Go to the chest and collect gold ingots and convert them to gold nuggets.', 'Step 3: Go to the crafting table and surround the carrot with gold nuggets to create a golden carrot.']",
"1": "Collaborate with agents around you to make 1 cooked_porkchop, 1 golden_carrot. Recipe for cooked_porkchop:\n['Step 1: Kill a pig and pick up 1 porkchop that is dropped.', 'Step 2: Get coal from your inventory or other agents.', 'Step 3: Put coal in the furnace', 'Step 4: Go to furnace and use it to cook the porkchop.']Recipe for golden_carrot:\n['Step 1: Go to the farm and collect 1 carrot.', 'Step 2: Go to the chest and collect gold ingots and convert them to gold nuggets.', 'Step 3: Go to the crafting table and surround the carrot with gold nuggets to create a golden carrot.']"
},
"initial_inventory": {
"0": {
"coal": 1,
"gold_ingot": 2
},
"1": {
"gold_ingot": 2
},
"2": {
"gold_ingot": 2
},
"3": {
"gold_ingot": 1
},
"4": {
"gold_ingot": 1
}
}
},
"multiagent_cooking_2_1_golden_carrot_1_suspicious_stew": {
"conversation": "Let's work together to make golden_carrot, suspicious_stew.",
"agent_count": 5,
"target": {
"golden_carrot": 1,
"suspicious_stew": 1
},
"type": "cooking",
"timeout": 500,
"recipes": {
"golden_carrot": [
"Step 1: Go to the farm and collect 1 carrot.",
"Step 2: Go to the chest and collect gold ingots and convert them to gold nuggets.",
"Step 3: Go to the crafting table and surround the carrot with gold nuggets to create a golden carrot."
],
"suspicious_stew": [
"Step 1: Go to the farm and collect 1 red mushroom, 1 brown mushroom.",
"Step 2: From your inventory or other agents get a bowl and 1 dandelion",
"Step 3: Go to the crafting table and combine the mushrooms, dandelion, and bowl to make suspicious stew."
]
},
"blocked_access_to_recipe": [],
"goal": {
"0": "Collaborate with agents around you to make 1 golden_carrot, 1 suspicious_stew. Recipe for golden_carrot:\n['Step 1: Go to the farm and collect 1 carrot.', 'Step 2: Go to the chest and collect gold ingots and convert them to gold nuggets.', 'Step 3: Go to the crafting table and surround the carrot with gold nuggets to create a golden carrot.']Recipe for suspicious_stew:\n['Step 1: Go to the farm and collect 1 red mushroom, 1 brown mushroom.', 'Step 2: From your inventory or other agents get a bowl and 1 dandelion', 'Step 3: Go to the crafting table and combine the mushrooms, dandelion, and bowl to make suspicious stew.']",
"1": "Collaborate with agents around you to make 1 golden_carrot, 1 suspicious_stew. Recipe for golden_carrot:\n['Step 1: Go to the farm and collect 1 carrot.', 'Step 2: Go to the chest and collect gold ingots and convert them to gold nuggets.', 'Step 3: Go to the crafting table and surround the carrot with gold nuggets to create a golden carrot.']Recipe for suspicious_stew:\n['Step 1: Go to the farm and collect 1 red mushroom, 1 brown mushroom.', 'Step 2: From your inventory or other agents get a bowl and 1 dandelion', 'Step 3: Go to the crafting table and combine the mushrooms, dandelion, and bowl to make suspicious stew.']"
},
"initial_inventory": {
"0": {
"gold_ingot": 2
},
"1": {
"gold_ingot": 2
},
"2": {
"gold_ingot": 2
},
"3": {
"gold_ingot": 1,
"bowl": 1
},
"4": {
"gold_ingot": 1,
"dandelion": 1
}
}
},
"multiagent_cooking_2_1_beetroot_soup_1_golden_carrot": {
"conversation": "Let's work together to make beetroot_soup, golden_carrot.",
"agent_count": 5,
"target": {
"beetroot_soup": 1,
"golden_carrot": 1
},
"type": "cooking",
"timeout": 500,
"recipes": {
"beetroot_soup": [
"Step 1: Go to the farm and collect 6 beetroot.",
"Step 2: From your inventory or other agents get a bowl.",
"Step 3: Go to the crafting table and combine the 6 beetroot and 1 bowl to make beetroot soup."
],
"golden_carrot": [
"Step 1: Go to the farm and collect 1 carrot.",
"Step 2: Go to the chest and collect gold ingots and convert them to gold nuggets.",
"Step 3: Go to the crafting table and surround the carrot with gold nuggets to create a golden carrot."
]
},
"blocked_access_to_recipe": [],
"goal": {
"0": "Collaborate with agents around you to make 1 beetroot_soup, 1 golden_carrot. Recipe for beetroot_soup:\n['Step 1: Go to the farm and collect 6 beetroot.', 'Step 2: From your inventory or other agents get a bowl.', 'Step 3: Go to the crafting table and combine the 6 beetroot and 1 bowl to make beetroot soup.']Recipe for golden_carrot:\n['Step 1: Go to the farm and collect 1 carrot.', 'Step 2: Go to the chest and collect gold ingots and convert them to gold nuggets.', 'Step 3: Go to the crafting table and surround the carrot with gold nuggets to create a golden carrot.']",
"1": "Collaborate with agents around you to make 1 beetroot_soup, 1 golden_carrot. Recipe for beetroot_soup:\n['Step 1: Go to the farm and collect 6 beetroot.', 'Step 2: From your inventory or other agents get a bowl.', 'Step 3: Go to the crafting table and combine the 6 beetroot and 1 bowl to make beetroot soup.']Recipe for golden_carrot:\n['Step 1: Go to the farm and collect 1 carrot.', 'Step 2: Go to the chest and collect gold ingots and convert them to gold nuggets.', 'Step 3: Go to the crafting table and surround the carrot with gold nuggets to create a golden carrot.']"
},
"initial_inventory": {
"0": {
"bowl": 1,
"gold_ingot": 2
},
"1": {
"gold_ingot": 2
},
"2": {
"gold_ingot": 2
},
"3": {
"gold_ingot": 1
},
"4": {
"gold_ingot": 1
}
}
}
}

View file

@ -7,7 +7,7 @@
"black_wool": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "pink_wool",
"number_of_target": 1,
"type": "techtree",
@ -29,7 +29,7 @@
"black_wool": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "lime_wool",
"number_of_target": 1,
"type": "techtree",
@ -54,7 +54,7 @@
"stick": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "purple_banner",
"number_of_target": 1,
"type": "techtree",
@ -68,32 +68,6 @@
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_soul_campfire_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft an soul_campfire",
"conversation": "Let's work together to craft an soul_campfire.",
"initial_inventory": {
"0": {
"oak_planks": 2,
"soul_sand": 1,
"dark_oak_log": 2
}
},
"agent_count": 2,
"target": "soul_campfire",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_bookshelf_full_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a bookshelf",
"conversation": "Let's work together to craft a bookshelf.",
@ -103,7 +77,7 @@
"book": 2
}
},
"agent_count": 2,
"agent_count": 1,
"target": "bookshelf",
"number_of_target": 1,
"type": "techtree",
@ -125,7 +99,7 @@
"iron_ingot": 2
}
},
"agent_count": 2,
"agent_count": 1,
"target": "compass",
"number_of_target": 1,
"type": "techtree",
@ -150,7 +124,7 @@
"oak_planks": 2
}
},
"agent_count": 2,
"agent_count": 1,
"target": "fishing_rod",
"number_of_target": 1,
"type": "techtree",
@ -175,7 +149,7 @@
"egg": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "cake",
"number_of_target": 1,
"type": "techtree",
@ -200,7 +174,7 @@
"carrot": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "golden_carrot",
"number_of_target": 1,
"type": "techtree",
@ -222,7 +196,7 @@
"paper": 5
}
},
"agent_count": 2,
"agent_count": 1,
"target": "map",
"number_of_target": 1,
"type": "techtree",
@ -246,7 +220,7 @@
"blue_dye": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "blue_wool",
"number_of_target": 1,
"type": "techtree",
@ -268,7 +242,7 @@
"green_dye": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "lime_wool",
"number_of_target": 1,
"type": "techtree",
@ -294,7 +268,7 @@
"lapis_lazuli": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "magenta_wool",
"number_of_target": 1,
"type": "techtree",
@ -309,54 +283,6 @@
],
"requires_ctable": false
},
"multiagent_crafting_chest_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a chest",
"conversation": "Let's work together to craft a chest.",
"initial_inventory": {
"0": {
"oak_log": 1
}
},
"agent_count": 2,
"target": "chest",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 1,
"timeout": 300,
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_barrel_partial_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a barrel",
"conversation": "Let's work together to craft a barrel.",
"initial_inventory": {
"0": {
"spruce_planks": 3,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "barrel",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 1,
"timeout": 300,
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [
],
"requires_ctable": true
},
"multiagent_crafting_lectern_full_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft a lectern",
"conversation": "Let's work together to craft a lectern.",
@ -366,7 +292,7 @@
"crafting_table": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "lectern",
"number_of_target": 1,
"type": "techtree",
@ -389,7 +315,7 @@
"gold_ingot": 2
}
},
"agent_count": 2,
"agent_count": 1,
"target": "clock",
"number_of_target": 1,
"type": "techtree",
@ -413,7 +339,7 @@
"paper": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "firework_rocket",
"number_of_target": 1,
"type": "techtree",
@ -439,7 +365,7 @@
"crafting_table": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "enchanting_table",
"number_of_target": 1,
"type": "techtree",
@ -455,29 +381,6 @@
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_jukebox_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a jukebox",
"conversation": "Let's work together to craft a jukebox.",
"initial_inventory": {
"0": {
"oak_log": 2,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "jukebox",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 1,
"timeout": 300,
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_light_gray_wool_full_plan__depth_1": {
"goal": "Collaborate with other agents to craft light_gray_wool",
"conversation": "Let's work together to craft light_gray_wool.",
@ -486,7 +389,7 @@
"black_dye": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "light_gray_wool",
"number_of_target": 1,
"type": "techtree",
@ -510,7 +413,7 @@
"crafting_table": 1
}
},
"agent_count": 2,
"agent_count": 1,
"target": "blast_furnace",
"number_of_target": 1,
"type": "techtree",
@ -534,7 +437,7 @@
"oak_planks": 6
}
},
"agent_count": 2,
"agent_count": 1,
"target": "activator_rail",
"number_of_target": 1,
"type": "techtree",
@ -549,31 +452,6 @@
],
"requires_ctable": true
},
"multiagent_crafting_campfire_partial_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft campfire",
"conversation": "Let's work together to craft campfire.",
"initial_inventory": {
"0": {
"oak_log": 8
}
},
"agent_count": 2,
"target": "campfire",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 2,
"timeout": 300,
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [
],
"requires_ctable": true
},
"multiagent_crafting_crossbow_full_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft a crossbow",
"conversation": "Let's work together to craft a crossbow.",
@ -583,7 +461,7 @@
"iron_ingot": 2
}
},
"agent_count": 2,
"agent_count": 1,
"target": "crossbow",
"number_of_target": 1,
"type": "techtree",

View file

@ -78,37 +78,6 @@
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_soul_campfire_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft an soul_campfire",
"conversation": "Let's work together to craft an soul_campfire.",
"initial_inventory": {
"0": {
"oak_planks": 2,
"soul_sand": 1,
"dark_oak_log": 2
},
"1": {
"oak_planks": 1,
"dark_oak_log": 1,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "soul_campfire",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_bookshelf_full_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a bookshelf",
"conversation": "Let's work together to craft a bookshelf.",
@ -225,13 +194,13 @@
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_golden_carrot_full_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a golden_carrot",
"conversation": "Let's work together to craft a golden_carrot.",
"multiagent_crafting_golden_apple_full_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a golden_apple",
"conversation": "Let's work together to craft a golden_apple.",
"initial_inventory": {
"0": {
"gold_nugget": 5,
"carrot": 1
"apple": 1
},
"1": {
"gold_nugget": 3,
@ -239,7 +208,7 @@
}
},
"agent_count": 2,
"target": "golden_carrot",
"target": "golden_apple",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
@ -252,35 +221,6 @@
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_map_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a map",
"conversation": "Let's work together to craft a map.",
"initial_inventory": {
"0": {
"paper": 5
},
"1": {
"paper": 3,
"compass": 1,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "map",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 0,
"timeout": 300,
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_blue_wool_full_plan__depth_0": {
"goal": "Collaborate with other agents to craft blue_wool",
"conversation": "Let's work together to craft blue_wool.",
@ -363,73 +303,18 @@
],
"requires_ctable": false
},
"multiagent_crafting_chest_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a chest",
"conversation": "Let's work together to craft a chest.",
"initial_inventory": {
"0": {
"oak_log": 1
},
"1": {
"oak_planks": 4,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "chest",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 1,
"timeout": 300,
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_barrel_partial_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a barrel",
"conversation": "Let's work together to craft a barrel.",
"initial_inventory": {
"0": {
"spruce_planks": 3,
"crafting_table": 1
},
"1": {
"spruce_planks": 3,
"wooden_slab": 1
}
},
"agent_count": 2,
"target": "barrel",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 1,
"timeout": 300,
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [
],
"requires_ctable": true
},
"multiagent_crafting_lectern_full_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft a lectern",
"conversation": "Let's work together to craft a lectern.",
"initial_inventory": {
"0": {
"birch_slab": 5,
"crafting_table": 1
"crafting_table": 1,
"book": 1
},
"1": {
"birch_log": 2,
"book": 3
"book": 2
}
},
"agent_count": 2,
@ -503,62 +388,6 @@
"missing_items": [],
"requires_ctable": false
},
"multiagent_crafting_enchanting_table_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft an enchanting_table",
"conversation": "Let's work together to craft an enchanting_table.",
"initial_inventory": {
"0": {
"diamond": 2,
"obsidian": 2,
"crafting_table": 1
},
"1": {
"obsidian": 2,
"book": 1
}
},
"agent_count": 2,
"target": "enchanting_table",
"number_of_target": 1,
"type": "techtree",
"max_depth": 0,
"depth": 0,
"timeout": 300,
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_jukebox_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a jukebox",
"conversation": "Let's work together to craft a jukebox.",
"initial_inventory": {
"0": {
"diamond": 1
},
"1": {
"oak_log": 2,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "jukebox",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 1,
"timeout": 300,
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_light_gray_wool_full_plan__depth_1": {
"goal": "Collaborate with other agents to craft light_gray_wool",
"conversation": "Let's work together to craft light_gray_wool.",
@ -586,34 +415,6 @@
],
"requires_ctable": false
},
"multiagent_crafting_blast_furnace_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a blast_furnace",
"conversation": "Let's work together to craft a blast_furnace.",
"initial_inventory": {
"0": {
"iron_ingot": 5,
"smooth_stone": 3
},
"1": {
"cobblestone": 8,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "blast_furnace",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 1,
"timeout": 300,
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [
],
"requires_ctable": true
},
"multiagent_crafting_activator_rail_full_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft activator_rail",
"conversation": "Let's work together to craft activator_rail.",
@ -643,35 +444,6 @@
],
"requires_ctable": true
},
"multiagent_crafting_campfire_partial_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft campfire",
"conversation": "Let's work together to craft campfire.",
"initial_inventory": {
"0": {
"oak_log": 8
},
"1": {
"coal": 1,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "campfire",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 2,
"timeout": 300,
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [
],
"requires_ctable": true
},
"multiagent_crafting_crossbow_full_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft a crossbow",
"conversation": "Let's work together to craft a crossbow.",

View file

@ -0,0 +1,2 @@
sleep 360
python3 tasks/evaluation_script.py --model gpt-4o --num_parallel 1 --num_exp 1 --exp_name "4o_1_agent_crafting" --template_profile ./profiles/tasks/crafting_profile.json --task_path tasks/crafting_tasks/test_tasks/1_agent.json --num_agents 1

View file

@ -0,0 +1,17 @@
from evaluation_script import analyze_json_file, extract_result, aggregate_results, check_folder_results
import argparse
def main():
parser = argparse.ArgumentParser(description="Analyze JSON files for construction tasks.")
parser.add_argument('--log_dir', type=str, nargs='+', help='Log dir to analyze')
args = parser.parse_args()
log_dir = args.log_dir[0]
print(log_dir)
results = check_folder_results(log_dir)
print(results)
if __name__ == "__main__":
main()