Skip to content

Commit

Permalink
added random policy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zsunberg committed Sep 13, 2018
1 parent 80d8177 commit fd7f13a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using POMDPs
using BeliefUpdaters
using POMDPSimulators
using POMDPModels
using Random

@testset "alpha" begin
include("test_alpha_policy.jl")
Expand All @@ -20,3 +21,6 @@ end
@testset "vector" begin
include("test_vector_policy.jl")
end
@testset "random" begin
include("test_random_solver.jl")
end
13 changes: 13 additions & 0 deletions test/test_random_solver.jl
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fd7f13a

Please sign in to comment.