Skip to content

Commit

Permalink
Update slimevolley.py
Browse files Browse the repository at this point in the history
Ensures otherAction is converted when using atari mode and a multi-agent setup
  • Loading branch information
williamcorsel authored May 10, 2021
1 parent e840033 commit 5bf9186
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions slimevolleygym/slimevolley.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,15 +775,15 @@ def step(self, action, otherAction=None):

if self.otherAction is not None:
otherAction = self.otherAction

if otherAction is None: # override baseline policy
obs = self.game.agent_left.getObservation()
otherAction = self.policy.predict(obs)

if self.atari_mode:
action = self.discreteToBox(action)
if otherAction is not None:
otherAction = self.discreteToBox(otherAction)
otherAction = self.discreteToBox(otherAction)

if otherAction is None: # override baseline policy
obs = self.game.agent_left.getObservation()
otherAction = self.policy.predict(obs)
self.game.agent_left.setAction(otherAction)
self.game.agent_right.setAction(action) # external agent is agent_right

Expand Down

0 comments on commit 5bf9186

Please sign in to comment.