Skip to content

Commit

Permalink
fixing prob. /w symbol/ string correspondence (#934)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremiah <[email protected]>
  • Loading branch information
Mytolo and jeremiahpslewis authored Jul 25, 2023
1 parent bd78e83 commit 9202202
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,21 @@ RLBase.action_space(env::PettingZooEnv, player::DefaultPlayer) = env.action_spac

function RLBase.act!(env::PettingZooEnv, actions::Dict{Symbol, Int})
@assert length(actions) == length(players(env))
for p in env.pyenv.agents
for p players(env)
pycall(env.pyenv.step, PyObject, actions[p])
end
end

function RLBase.act!(env::PettingZooEnv, actions::Dict{Symbol, Real})
@assert length(actions) == length(env.pyenv.agents)
for p in env.pyenv.agents
for p players(env)
pycall(env.pyenv.step, PyObject, np.array(actions[p]; dtype=np.float32))
end
end

function RLBase.act!(env::PettingZooEnv, actions::Dict{Symbol, Vector})
@assert length(actions) == length(env.pyenv.agents)
for p in env.pyenv.agents
for p players(env)
RLBase.act!(env, p)
end
end
Expand Down

0 comments on commit 9202202

Please sign in to comment.