Skip to content

Commit

Permalink
Revert "Changed reference solver (SARSOP -> POMDPSolve)"
Browse files Browse the repository at this point in the history
This reverts commit 978f549.
  • Loading branch information
Omastto1 committed Apr 11, 2021
1 parent 978f549 commit e2eaa0c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Expand Up @@ -23,8 +23,8 @@ julia = "1.1"
[extras]
POMDPModels = "355abbd5-f08e-5560-ac9e-8b5f2592a0ca"
POMDPSimulators = "e0d0a172-29c6-5d4e-96d0-f262df5d01fd"
SARSOP = "cef570c6-3a94-5604-96b7-1a5e143043f2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
POMDPSolve = "a575d7f4-a5df-53f5-8ba4-9d691c1ba8ff"

[targets]
test = ["Test", "POMDPModels", "POMDPSimulators", "POMDPSolve"]
test = ["SARSOP", "Test", "POMDPModels", "POMDPSimulators"]
19 changes: 13 additions & 6 deletions test/runtests.jl
@@ -1,20 +1,20 @@
using Test
using POMDPModels
using POMDPs
using POMDPSolve
using SARSOP
using BeliefUpdaters

using PointBasedValueIteration

@testset "Comparison with POMDPSolve" begin
@testset "Comparison with SARSOP" begin
pomdps = [TigerPOMDP(), BabyPOMDP(), MiniHallway()]

for pomdp in pomdps
solver = PBVISolver()
policy = solve(solver, pomdp)

pomdpsolver = POMDPSolveSolver(verbose=:False)
pomdpsolver_policy = solve(pomdpsolver, pomdp)
sarsop = SARSOPSolver(verbose=false)
sarsop_policy = solve(sarsop, pomdp)

B = []
if typeof(pomdp) == MiniHallway
Expand All @@ -35,7 +35,14 @@ using PointBasedValueIteration
end

pbvi_vals = [value(policy, b) for b in B]
pomdpsolver_vals = [value(pomdpsolver_policy, b) for b in B]
@test isapprox(pomdpsolver_vals, pbvi_vals, rtol=0.1)
if typeof(pomdp) == MiniHallway
sarsop_vals = [value(sarsop_policy, b) for b in B]
# Test passes when the value function is multiplied
# @test isapprox(sarsop_vals * 3.4 , pbvi_vals, rtol=0.3)
@test_broken isapprox(sarsop_vals, pbvi_vals, rtol=0.3)
else
sarsop_vals = [value(sarsop_policy, b) for b in B]
@test isapprox(sarsop_vals, pbvi_vals, rtol=0.1)
end
end
end

0 comments on commit e2eaa0c

Please sign in to comment.