Commit 0b05592d authored by Siddhartha Laghuvarapu's avatar Siddhartha Laghuvarapu
Browse files

Modify rollout interface for step

parent eba0ec66
......@@ -10,7 +10,7 @@ class RandomNeuralMMOAgent(NeuralMMOAgent):
self.action_space = get_action_spaces()
def register_reset(self, observations):
action = self.agent.compute_actions(observations)
action = self.get_action(observations)
return action
def compute_action(self, observations, info=None):
......
......@@ -63,7 +63,7 @@ class NeuralMMOEval(gym.Env):
)
return actions
def step(self):
def step(self,action):
self.observations, dones, rewards, _ = self.env.step(self.actions)
for agent in dones:
if dones[agent] == -1:
......
......@@ -16,9 +16,11 @@ def main():
total_rewards = 0
for _ in trange(n_episodes):
obs = env.reset()
action = player_agent.register_reset(obs)
done = False
while done == False:
obs, dones, rewards, _ = env.step()
obs, dones, rewards, _ = env.step(action)
action = player_agent.compute_action(action)
total_rewards += rewards["player"]
done = dones["player"]
......
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