Commit 30ba08d8 authored by Siddhartha Laghuvarapu's avatar Siddhartha Laghuvarapu
Browse files

Change agents in players.yaml

parent 4beb4afe
...@@ -128,4 +128,6 @@ dmypy.json ...@@ -128,4 +128,6 @@ dmypy.json
.pyre/ .pyre/
#NeuralMMO repository #NeuralMMO repository
neural-mmo/ neural-mmo/forge/embyr
neural-mmo/docs
neural-mmo/resource
...@@ -14,11 +14,10 @@ class NeuralBaselineAgent(NeuralMMOAgent): ...@@ -14,11 +14,10 @@ class NeuralBaselineAgent(NeuralMMOAgent):
def register_reset(self, observations): def register_reset(self, observations):
obs = {0:observations} obs = {0:observations}
actions,self.state,_ = self.trainer.compute_actions(obs,state={},policy_id='policy_0') actions,self.state,_ = self.trainer.compute_actions(obs,state={},policy_id='policy_0')
# action = self.get_action(observations)
return actions[0] return actions[0]
def compute_action(self, observations, info=None): def compute_action(self, observations):
obs = {0:observations} obs = {0:observations}
actions,self.state,_ = self.trainer.compute_actions(obs,state={},policy_id='policy_0') actions,self.state,_ = self.trainer.compute_actions(obs,state={},policy_id='policy_0')
# action = self.get_action(observations)
return actions[0] return actions[0]
...@@ -10,14 +10,13 @@ class RandomNeuralMMOAgent(NeuralMMOAgent): ...@@ -10,14 +10,13 @@ class RandomNeuralMMOAgent(NeuralMMOAgent):
self.action_space = get_action_spaces() self.action_space = get_action_spaces()
def register_reset(self, observations): def register_reset(self, observations):
action = self.get_action(observations) action = FlexDict(defaultdict(FlexDict))
return action for atn in sorted(self.action_space):
for arg in sorted(atn.edges):
def compute_action(self, observations, info=None): action[atn][arg] = self.action_space[atn][arg].sample()
action = self.get_action(observations)
return action return action
def get_action(self, observations): def compute_action(self, observations):
action = FlexDict(defaultdict(FlexDict)) action = FlexDict(defaultdict(FlexDict))
for atn in sorted(self.action_space): for atn in sorted(self.action_space):
for arg in sorted(atn.edges): for arg in sorted(atn.edges):
......
# Define agents that will be used for evaluation. # Define agents that will be used for evaluation.
# Agents need to implement abstract class NeuralMMOAgent. # Agents need to implement abstract class NeuralMMOAgent.
# Agents will be located in agents/ # Agents will be located in agents/
# Number of opponent agents is exactly 127 # Number of opponent agents is exactly 127
player_agent: player_agent:
file: neural_baseline_agent file: neural_baseline_agent
...@@ -17,12 +17,18 @@ opponent_agents: ...@@ -17,12 +17,18 @@ opponent_agents:
agent_2: agent_2:
file: scripted_baseline_agent file: scripted_baseline_agent
agent_class: BaselineForageAgent agent_class: BaselineCombatAgent
agent_type: scripted agent_type: scripted
num_agents: 51 num_agents: 45
agent_3: agent_3:
file: random_agent
agent_class: RandomNeuralMMOAgent
agent_type: neural
num_agents: 6
agent_4:
file: scripted_baseline_agent file: scripted_baseline_agent
agent_class: BaselineForageAgent agent_class: BaselineRandomAgent
agent_type: scripted agent_type: scripted
num_agents: 26 num_agents: 26
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