From e9e8cf3c88b6226f183032a43a5cd9cbe56fb343 Mon Sep 17 00:00:00 2001 From: Isadora White Date: Sun, 9 Mar 2025 12:02:48 -0700 Subject: [PATCH] single agent task support in evaluation script --- evaluation_script.py | 12 ++++++-- tasks/single_agent/crafting_train.json | 38 +++++++++++++++++++------- 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/evaluation_script.py b/evaluation_script.py index 37bf3bb..708cf84 100644 --- a/evaluation_script.py +++ b/evaluation_script.py @@ -181,7 +181,11 @@ def launch_server_experiment(task_path, # set up server and agents session_name = str(server_port - 55916) - if num_agents == 2: + if num_agents == 1: + agent_names = [f"Andy_{session_name}"] + models = [model] + apis = [api] + elif num_agents == 2: agent_names = [f"Andy_{session_name}", f"Jill_{session_name}"] models = [model] * 2 apis = [api] * 2 @@ -192,7 +196,11 @@ def launch_server_experiment(task_path, make_profiles(agent_names, models, apis, template_profile=template_profile) agent_profiles = [f"./{agent}.json" for agent in agent_names] - agent_profiles_str = f"'[\"{agent_profiles[0]}\", \"{agent_profiles[1]}\"]'" + + if num_agents == 1: + agent_profiles_str = f"'[\"{agent_profiles[0]}\"]'" + elif num_agents == 2: + agent_profiles_str = f"'[\"{agent_profiles[0]}\", \"{agent_profiles[1]}\"]'" print(agent_profiles_str) launch_world(server_path, session_name="server_" + session_name, agent_names=agent_names) diff --git a/tasks/single_agent/crafting_train.json b/tasks/single_agent/crafting_train.json index 96590f7..0da1b89 100644 --- a/tasks/single_agent/crafting_train.json +++ b/tasks/single_agent/crafting_train.json @@ -1,4 +1,22 @@ { + "crafting_stick": { + "goal": "Craft sticks.", + "initial_inventory": {}, + "agent_count": 1, + "target": "stick", + "number_of_target": 4, + "type": "techtree", + "timeout": 500 + }, + "crafting_oak_log": { + "goal": "Get oak logs.", + "initial_inventory": {}, + "agent_count": 1, + "target": "oak_log", + "number_of_target": 1, + "type": "techtree", + "timeout": 500 + }, "crafting_wooden_pickaxe": { "goal": "Craft a wooden pickaxe.", "initial_inventory": {}, @@ -6,7 +24,7 @@ "target": "wooden_pickaxe", "number_of_target": 1, "type": "techtree", - "timeout": 120 + "timeout": 500 }, "crafting_stone_pickaxe": { "goal": "Craft a stone pickaxe.", @@ -15,7 +33,7 @@ "target": "stone_pickaxe", "number_of_target": 1, "type": "techtree", - "timeout": 240 + "timeout": 500 }, "crafting_iron_pickaxe": { "goal": "Craft an iron pickaxe.", @@ -28,7 +46,7 @@ "target": "iron_pickaxe", "number_of_target": 1, "type": "techtree", - "timeout": 240 + "timeout": 500 }, "crafting_shears": { "goal": "Craft shears.", @@ -41,7 +59,7 @@ "target": "shears", "number_of_target": 1, "type": "techtree", - "timeout": 360 + "timeout": 500 }, "crafting_redstone": { "goal": "Get redstone.", @@ -54,7 +72,7 @@ "target": "redstone", "number_of_target": 1, "type": "techtree", - "timeout": 360 + "timeout": 500 }, "crafting_light_gray_banner": { "goal": "Craft a light gray banner.", @@ -69,7 +87,7 @@ "target": "light_gray_banner", "number_of_target": 1, "type": "techtree", - "timeout": 360 + "timeout": 500 }, "crafting_brush_missing_copper_ingot_": { "goal": "Craft a brush.", @@ -83,7 +101,7 @@ "target": "brush", "number_of_target": 1, "type": "techtree", - "timeout": 360 + "timeout": 500 }, "crafting_shield_missing_planks": { "goal": "Craft a shield.", @@ -96,7 +114,7 @@ "target": "shield", "number_of_target": 1, "type": "techtree", - "timeout": 360 + "timeout": 500 }, "crafting_shield_missing_iron_ingot": { "goal": "Craft a shield.", @@ -109,7 +127,7 @@ "target": "shield", "number_of_target": 1, "type": "techtree", - "timeout": 360 + "timeout": 500 }, "crafting_stone_hoe": { "goal": "Craft a stone hoe.", @@ -122,6 +140,6 @@ "target": "stone_hoe", "number_of_target": 1, "type": "techtree", - "timeout": 360 + "timeout": 500 } } \ No newline at end of file