Skip to content

Commit

Permalink
switched to POMDPTools
Browse files Browse the repository at this point in the history
  • Loading branch information
zsunberg committed Nov 15, 2023
1 parent abb1c9e commit 6ec7e21
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
8 changes: 2 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ version = "0.1.1"
AutoHashEquals = "15f4f7f2-30c1-5605-9d31-71845cf9641f"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
POMDPModelTools = "08074719-1b2a-587c-a292-00f91cc44415"
POMDPSimulators = "e0d0a172-29c6-5d4e-96d0-f262df5d01fd"
POMDPTools = "7588e00f-9cae-40de-98dc-e0c70c48cdd7"
POMDPs = "a93abf59-7444-517b-a68a-c42f96afdd7d"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
ParticleFilters = "c8b314e2-9260-5cf8-ae76-3be7461ca6d0"
Expand All @@ -23,8 +22,6 @@ TikzPictures = "37f6aa50-8035-52d0-81c2-5a1d08754b2d"
AutoHashEquals = "0.2, 1, 2"
Distributions = "0.22 - 0.24, 0.25"
IterTools = "1"
POMDPModelTools = "0.3"
POMDPSimulators = "0.3"
POMDPs = "0.9"
Parameters = "0.12"
ParticleFilters = "0.5"
Expand All @@ -36,8 +33,7 @@ julia = "1"

[extras]
POMDPModels = "355abbd5-f08e-5560-ac9e-8b5f2592a0ca"
POMDPPolicies = "182e52fb-cfd0-5e46-8c26-fd0667c990f4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["POMDPModels", "POMDPPolicies", "Test"]
test = ["POMDPModels", "Test"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@ The Laser Tag Problem from http://bigbird.comp.nus.edu.sg/m2ap/wordpress/wp-cont

![image](https://user-images.githubusercontent.com/4240491/181133301-11704255-3e1a-4ec0-957a-8024d8159a8a.png)

## Installation

Note: This package is not currently registered (because the name is not suitable). To install it from the julia REPL, use
```julia
] add https://github.com/JuliaPOMDP/LaserTag.jl.git
```

See [POMDP Gallery](https://github.com/JuliaPOMDP/POMDPGallery.jl#lasertag) for usage.
2 changes: 1 addition & 1 deletion debug/profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pol = RandomPolicy(p, rng=MersenneTwister(1))

sim = RolloutSimulator(max_steps=100, rng=MersenneTwister(2))

fltr = SIRParticleFilter(p, 10000)
fltr = BootstrapFilter(p, 10000)

@time simulate(sim, p, pol, fltr)
@time simulate(sim, p, pol, fltr)
Expand Down
2 changes: 1 addition & 1 deletion debug/profile_qmdp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ProfileView.view()

# sim = HistoryRecorder(max_steps=5, rng=MersenneTwister(2), show_progress=true)
#
# filter = SIRParticleFilter(p, 10000)
# filter = BootstrapFilter(p, 10000)
#
# #=
# b = initialize_belief(filter, initial_state_distribution(p))
Expand Down
2 changes: 1 addition & 1 deletion notebook/Visualization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
],
"source": [
"p = gen_lasertag(rng=MersenneTwister(5), reading_std=2.5, discrete=true)\n",
"up = SIRParticleFilter(p, 100000)\n",
"up = BootstrapFilter(p, 100000)\n",
"policy = solve(QMDPSolver(), p, verbose=true)\n",
"# policy = solve(OptimalMLSolver(ValueIterationSolver()), p)\n",
"hr = HistoryRecorder(max_steps=100, rng=MersenneTwister(3))\n",
Expand Down
3 changes: 1 addition & 2 deletions src/LaserTag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ module LaserTag

# package code goes here
using POMDPs
using POMDPModelTools
using POMDPTools
using Random
using Printf
using StaticArrays
using SpecialFunctions
using AutoHashEquals
using POMDPSimulators
using Parameters
using StatsBase
using Distributions
Expand Down
2 changes: 1 addition & 1 deletion src/visualization.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using TikzPictures
using ParticleFilters

function POMDPModelTools.render(m::LaserTagPOMDP, step)
function POMDPTools.render(m::LaserTagPOMDP, step)
return LaserTagVis(m,
get(step, :a, nothing),
get(step, :r, nothing),
Expand Down
12 changes: 5 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ using LaserTag
using Random
using Test
using POMDPModels
using POMDPModelTools
using POMDPPolicies
using POMDPSimulators
using POMDPTools
using ParticleFilters
using POMDPs

Expand All @@ -14,7 +12,7 @@ pol = RandomPolicy(p, rng=MersenneTwister(1))

sim = HistoryRecorder(max_steps=10, rng=MersenneTwister(2))

filter = SIRParticleFilter(p, 10000)
filter = BootstrapFilter(p, 10000)

hist = simulate(sim, p, pol, filter)

Expand Down Expand Up @@ -63,7 +61,7 @@ pol = RandomPolicy(p, rng=MersenneTwister(1))

sim = HistoryRecorder(max_steps=10, rng=MersenneTwister(2))

filter = SIRParticleFilter(p, 10000)
filter = BootstrapFilter(p, 10000)

hist = simulate(sim, p, pol, filter)

Expand All @@ -73,8 +71,8 @@ try
io = IOBuffer()
show(io, MIME("image/png"), render(p, first(eachstep(hist))))
catch ex
@warn("Unable to complete visualization tests.")
sprint(showerror, ex)
@warn("Unable to complete visualization tests.",
error=sprint(showerror, ex))
end

s = rand(MersenneTwister(4), initialstate(p))
Expand Down

0 comments on commit 6ec7e21

Please sign in to comment.