@@ -60,7 +60,7 @@ RLBase.current_player(env::OpenSpielEnv) = OpenSpiel.current_player(env.state)
6060RLBase. chance_player (env:: OpenSpielEnv ) = convert (Int, OpenSpiel. CHANCE_PLAYER)
6161
6262function RLBase. players (env:: OpenSpielEnv )
63- p = 0 : (num_players (env. game) - 1 )
63+ p = 0 : (num_players (env. game)- 1 )
6464 if ChanceStyle (env) === EXPLICIT_STOCHASTIC
6565 (p... , RLBase. chance_player (env))
6666 else
@@ -73,9 +73,9 @@ function RLBase.action_space(env::OpenSpielEnv, player)
7373 # !!! this bug is already fixed in OpenSpiel
7474 # replace it with the following one later
7575 # ZeroTo(max_chance_outcomes(env.game)-1)
76- ZeroTo ( max_chance_outcomes (env. game))
76+ Space ( 0 : max_chance_outcomes (env. game))
7777 else
78- ZeroTo ( num_distinct_actions (env. game) - 1 )
78+ Space ( 0 : num_distinct_actions (env. game)- 1 )
7979 end
8080end
8181
@@ -91,7 +91,7 @@ function RLBase.prob(env::OpenSpielEnv, player)
9191 # @assert player == chance_player(env)
9292 p = zeros (length (action_space (env)))
9393 for (k, v) in chance_outcomes (env. state)
94- p[k + 1 ] = v
94+ p[k+ 1 ] = v
9595 end
9696 p
9797end
@@ -102,7 +102,7 @@ function RLBase.legal_action_space_mask(env::OpenSpielEnv, player)
102102 num_distinct_actions (env. game)
103103 mask = BitArray (undef, n)
104104 for a in legal_actions (env. state, player)
105- mask[a + 1 ] = true
105+ mask[a+ 1 ] = true
106106 end
107107 mask
108108end
@@ -126,7 +126,7 @@ function RLBase.state(env::OpenSpielEnv, ss::RLBase.AbstractStateStyle, player)
126126 if player
< 0 # TODO : revisit this in [email protected] 127127 @warn " unexpected player $player , falling back to default state value." maxlog = 1
128128 s = state_space (env)
129- if s isa WorldSpace
129+ if s === Space (AbstractString)
130130 " "
131131 elseif s isa Array{<: Interval }
132132 rand (s)
@@ -149,19 +149,15 @@ RLBase.state_space(
149149 env:: OpenSpielEnv ,
150150 :: Union{InformationSet{String},Observation{String}} ,
151151 p,
152- ) = WorldSpace {AbstractString} ( )
152+ ) = Space (AbstractString )
153153
154154RLBase. state_space (env:: OpenSpielEnv , :: InformationSet{Array} ,
155155 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))... )
159157
160158RLBase. state_space (env:: OpenSpielEnv , :: Observation{Array} ,
161159 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))... )
165161
166162Random. seed! (env:: OpenSpielEnv , s) = @warn " seed!(OpenSpielEnv) is not supported currently."
167163
0 commit comments