@@ -60,7 +60,7 @@ RLBase.current_player(env::OpenSpielEnv) = OpenSpiel.current_player(env.state)
60
60
RLBase. chance_player (env:: OpenSpielEnv ) = convert (Int, OpenSpiel. CHANCE_PLAYER)
61
61
62
62
function RLBase. players (env:: OpenSpielEnv )
63
- p = 0 : (num_players (env. game) - 1 )
63
+ p = 0 : (num_players (env. game)- 1 )
64
64
if ChanceStyle (env) === EXPLICIT_STOCHASTIC
65
65
(p... , RLBase. chance_player (env))
66
66
else
@@ -73,9 +73,9 @@ function RLBase.action_space(env::OpenSpielEnv, player)
73
73
# !!! this bug is already fixed in OpenSpiel
74
74
# replace it with the following one later
75
75
# ZeroTo(max_chance_outcomes(env.game)-1)
76
- ZeroTo ( max_chance_outcomes (env. game))
76
+ Space ( 0 : max_chance_outcomes (env. game))
77
77
else
78
- ZeroTo ( num_distinct_actions (env. game) - 1 )
78
+ Space ( 0 : num_distinct_actions (env. game)- 1 )
79
79
end
80
80
end
81
81
@@ -91,7 +91,7 @@ function RLBase.prob(env::OpenSpielEnv, player)
91
91
# @assert player == chance_player(env)
92
92
p = zeros (length (action_space (env)))
93
93
for (k, v) in chance_outcomes (env. state)
94
- p[k + 1 ] = v
94
+ p[k+ 1 ] = v
95
95
end
96
96
p
97
97
end
@@ -102,7 +102,7 @@ function RLBase.legal_action_space_mask(env::OpenSpielEnv, player)
102
102
num_distinct_actions (env. game)
103
103
mask = BitArray (undef, n)
104
104
for a in legal_actions (env. state, player)
105
- mask[a + 1 ] = true
105
+ mask[a+ 1 ] = true
106
106
end
107
107
mask
108
108
end
@@ -126,7 +126,7 @@ function RLBase.state(env::OpenSpielEnv, ss::RLBase.AbstractStateStyle, player)
126
126
if player < 0 # TODO : revisit this in OpenSpiel@v0.2
127
127
@warn " unexpected player $player , falling back to default state value." maxlog = 1
128
128
s = state_space (env)
129
- if s isa WorldSpace
129
+ if s === Space (AbstractString)
130
130
" "
131
131
elseif s isa Array{<: Interval }
132
132
rand (s)
@@ -149,19 +149,15 @@ RLBase.state_space(
149
149
env:: OpenSpielEnv ,
150
150
:: Union{InformationSet{String},Observation{String}} ,
151
151
p,
152
- ) = WorldSpace {AbstractString} ( )
152
+ ) = Space (AbstractString )
153
153
154
154
RLBase. state_space (env:: OpenSpielEnv , :: InformationSet{Array} ,
155
155
p,
156
- ) = Space (
157
- fill (typemin (Float64).. typemax (Float64), reverse (information_state_tensor_shape (env. game))... ),
158
- )
156
+ ) = Space (Float64, reverse (information_state_tensor_shape (env. game))... )
159
157
160
158
RLBase. state_space (env:: OpenSpielEnv , :: Observation{Array} ,
161
159
p,
162
- ) = Space (
163
- fill (typemin (Float64).. typemax (Float64), reverse (observation_tensor_shape (env. game))... ),
164
- )
160
+ ) = Space (Float64, reverse (observation_tensor_shape (env. game))... )
165
161
166
162
Random. seed! (env:: OpenSpielEnv , s) = @warn " seed!(OpenSpielEnv) is not supported currently."
167
163
0 commit comments