Commit 33c78bec authored by Siddhartha Laghuvarapu's avatar Siddhartha Laghuvarapu
Browse files

resolve merge conflicts

parents 9fce0a0d 895dbaed
from agents.neural_baseline_agent import NeuralBaselineAgent
from agents.random_agent import RandomNeuralMMOAgent
from agents.scripted_baseline_agent import BaselineForageAgent, BaselineCombatAgent, BaselineRandomAgent
from agents.neural_baseline_agent import NeuralBaselineAgent, NeuralBaselineMultiAgent
#from agents.random_agent import RandomNeuralMMOAgent
from agents.scripted_baseline_agent import BaselineForageAgent, BaselineCombatAgent, BaselineRandomAgent, ScriptedBaselineMultiAgent
__all__ = [
"NeuralBaselineAgent",
"RandomNeuralMMOAgent",
"BaselineRandomAgent",
"BaselineCombatAgent",
"BaselineForageAgent",
"NeuralBaselineMultiAgent",
"ScriptedBaselineMultiAgent",
]
......@@ -66,8 +66,6 @@ class ProxyEnv(Env):
def assign_agents(player_agent, opponent_agents):
player_index = 0
if len(opponent_agents) != 127:
raise Exception("Number of opponent agents should add up to exactly 127")
random.shuffle(opponent_agents)
player_index = random.randint(0, 7)
agents = copy.deepcopy(opponent_agents)
......@@ -93,7 +91,7 @@ def run_episode(player_index, agents, N_TIME_STEPS):
"agent":agents[agent_idx],
"agent_idx":agent_idx,
"player_idx":player_idx,
"agent_type":agents[agent_idx].agent_type[player_idx]
"agent_type":agents[agent_idx].agent_types[player_idx]
}
)
......@@ -111,12 +109,12 @@ def run_episode(player_index, agents, N_TIME_STEPS):
individual_meta_map = {x["player_idx"]:x["agent_idx"] for x in individual_agents}
for idx, agent in enumerate(individual_agents):
if agent[idx]["agent_type"] == "neural":
if agent["agent_type"] == "neural":
neural_agents.add(agent_entid_map[idx])
actions = {}
for entid in entids:
agent = individual_agents[entid_agent_map[entid]["agent"]]
agent = individual_agents[entid_agent_map[entid]]["agent"]
player_idx = individual_agents[entid_agent_map[entid]["player_idx"]]
meta_agent = individual_meta_map[player_idx]
meta_entids = [[idx,agent_entid_map[idx]] for idx in meta_individual_map[meta_agent]]
......@@ -150,7 +148,7 @@ def run_episode(player_index, agents, N_TIME_STEPS):
if entid in dead_agents:
continue
agent = individual_agents[entid_agent_map[entid]["agent"]]
agent = individual_agents[entid_agent_map[entid]]["agent"]
player_idx = individual_agents[entid_agent_map[entid]["player_idx"]]
meta_agent = individual_meta_map[player_idx]
meta_entids = [[idx,agent_entid_map[idx]] for idx in meta_individual_map[meta_agent]]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment