diff --git a/test/runtests.jl b/test/runtests.jl index b5761c0..13276cb 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,6 +4,7 @@ using POMDPs using BeliefUpdaters using POMDPSimulators using POMDPModels +using Random @testset "alpha" begin include("test_alpha_policy.jl") @@ -20,3 +21,6 @@ end @testset "vector" begin include("test_vector_policy.jl") end +@testset "random" begin + include("test_random_solver.jl") +end diff --git a/test/test_random_solver.jl b/test/test_random_solver.jl new file mode 100644 index 0000000..b278cc1 --- /dev/null +++ b/test/test_random_solver.jl @@ -0,0 +1,13 @@ +let + problem = BabyPOMDP() + + solver = RandomSolver(rng=MersenneTwister(1)) + + policy = solve(solver, problem) + + sim = RolloutSimulator(max_steps=10, rng=MersenneTwister(1)) + + r = simulate(sim, problem, policy, updater(policy), initial_state_distribution(problem)) + + @test isapprox(r, -27.27829, atol=1e-3) +end