This repository was archived by the owner on Aug 11, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +29
-164
lines changed Expand file tree Collapse file tree 3 files changed +29
-164
lines changed Original file line number Diff line number Diff line change @@ -190,3 +190,23 @@ function test_interfaces!(env)
190
190
191
191
reset! (env)
192
192
end
193
+
194
+ function test_runnable! (env, n = 1000 ;rng= Random. GLOBAL_RNG)
195
+ @testset " random policy with $(nameof (env)) " begin
196
+ reset! (env)
197
+ for _ in 1 : n
198
+ A = legal_action_space (env)
199
+ a = rand (rng, A)
200
+ @test a in A
201
+
202
+ S = state_space (env)
203
+ s = state (env)
204
+ @test s in S
205
+ env (a)
206
+ if is_terminated (env)
207
+ reset! (env)
208
+ end
209
+ end
210
+ reset! (env)
211
+ end
212
+ end
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -377,17 +377,17 @@ DefaultStateStyle(ss::Tuple{Vararg{<:AbstractStateStyle}}) = first(ss)
377
377
# General
378
378
# ####
379
379
380
- struct DefaultPlayer end
381
- const DEFAULT_PLAYER = DefaultPlayer ()
380
+ @api struct DefaultPlayer end
381
+ @api const DEFAULT_PLAYER = DefaultPlayer ()
382
382
383
- struct ChancePlayer end
384
- const CHANCE_PLAYER = ChancePlayer ()
383
+ @api struct ChancePlayer end
384
+ @api const CHANCE_PLAYER = ChancePlayer ()
385
385
386
- struct SimultaneousPlayer end
387
- const SIMULTANEOUS_PLAYER = SimultaneousPlayer ()
386
+ @api struct SimultaneousPlayer end
387
+ @api const SIMULTANEOUS_PLAYER = SimultaneousPlayer ()
388
388
389
- struct Spector end
390
- const SPECTOR = Spector ()
389
+ @api struct Spector end
390
+ @api const SPECTOR = Spector ()
391
391
392
392
@api (env:: AbstractEnv )(action, player = current_player (env))
393
393
@@ -400,7 +400,7 @@ Make an independent copy of `env`,
400
400
@api copy (env:: AbstractEnv ) = deepcopy (env)
401
401
@api copyto! (dest:: AbstractEnv , src:: AbstractEnv )
402
402
403
- @env_api nameof (env:: AbstractEnv ) = nameof (typeof (env))
403
+ @api nameof (env:: AbstractEnv ) = nameof (typeof (env))
404
404
405
405
"""
406
406
Get the action distribution of chance player.
You can’t perform that action at this time.
0 commit comments