using Test
using POMDPModels

let
    rng = MersenneTwister(41)
    p = SimpleLightDark()
    dp = DSimpleLightDark()

    @test discount(p) == 0.95
    @test discount(dp) == 0.95

    s0 = rand(rng, initialstate(p))
    s0 = rand(rng, initialstate(dp))

    s0 = 0
    s0, _, r = @gen(:sp, :o, :r)(p, s0, +1, rng)
    @test s0 == 1
    @test r == -1.0
    s1, _, r = @gen(:sp, :o, :r)(p, s0, 0, rng)
    @test isterminal(p, s1) == true
    @test r == -100.0
    s2 = 10
    obs = rand(rng, observation(p, s2))
    @test abs(obs-10.0) <= 0.1
    obs = rand(rng, observation(dp, s2))
    @test pdf(observation(dp, s2), 71) == pdf(observation(dp, s2), 72)
end
