single agent task support in evaluation script

This commit is contained in:
Isadora White 2025-03-09 12:02:48 -07:00
parent cf011f02bc
commit e9e8cf3c88
2 changed files with 38 additions and 12 deletions

View file

@ -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)

View file

@ -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
}
}