Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgraded to POMDPTools #93

Merged
merged 1 commit into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name = "MCTS"
uuid = "e12ccd36-dcad-5f33-8774-9175229e7b33"
repo = "https://github.com/JuliaPOMDP/MCTS.jl"
version = "0.5.0"
version = "0.5.1"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
D3Trees = "e3df1716-f71e-5df9-9e2d-98e193103c45"
POMDPLinter = "f3bd98c0-eb40-45e2-9eb1-f2763262d755"
POMDPModelTools = "08074719-1b2a-587c-a292-00f91cc44415"
POMDPPolicies = "182e52fb-cfd0-5e46-8c26-fd0667c990f4"
POMDPSimulators = "e0d0a172-29c6-5d4e-96d0-f262df5d01fd"
POMDPTools = "7588e00f-9cae-40de-98dc-e0c70c48cdd7"
POMDPs = "a93abf59-7444-517b-a68a-c42f96afdd7d"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Expand All @@ -19,9 +17,7 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Colors = "0.9, 0.10, 0.11, 0.12"
D3Trees = "0.3"
POMDPLinter = "0.1"
POMDPModelTools = "0.3"
POMDPPolicies = "0.3, 0.4"
POMDPSimulators = "0.3"
POMDPTools = "0.1"
POMDPs = "0.9"
ProgressMeter = "1"
julia = "1"
Expand Down
2 changes: 1 addition & 1 deletion bench/non-terminal_gw.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using POMDPs
using POMDPModels
using MCTS
using POMDPSimulators
using POMDPTools
using ProgressMeter
using Random
# using ProfileView
Expand Down
2 changes: 1 addition & 1 deletion bench/non-terminal_gw_dpw.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using POMDPs
using POMDPModels
using MCTS
using POMDPSimulators
using POMDPTools
using ProgressMeter
using Random
# using ProfileView
Expand Down
6 changes: 3 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ POMDPs.add("MCTS")

## Usage

Problems should be defined using the [POMDPs.jl generative interface](https://juliapomdp.github.io/POMDPs.jl/stable/generative/).
Problems should be defined using the [POMDPs.jl generative interface](https://juliapomdp.github.io/POMDPs.jl/stable/def_pomdp/#Using-a-single-generative-function-instead-of-separate-T,-Z,-and-R).

To see the methods that you need to implement to use MCTS with your MDP (assume you're defining an MDP of type `MyMDP` with states represented by integers and 3 possible integer actions), run
```julia
Expand Down Expand Up @@ -49,9 +49,9 @@ For rollout(::SolvedRolloutEstimator, ::MDP, ::Any, ::Int64) (in estimate_value(
For simulate(::RolloutSimulator, ::MDP, ::Policy, ::Any) (in rollout(::SolvedRolloutEstimator, ::MDP, ::Any, ::Int64)):
[✔] action(::RandomPolicy, ::Int64)
```
indicating that the generative interface still needs to be implemented for `MyMDP` to be used with MCTS. See the [geneartive interface documentation](http://juliapomdp.github.io/POMDPs.jl/stable/generative/) for further details.
indicating that the generative interface still needs to be implemented for `MyMDP` to be used with MCTS. See the [geneartive interface documentation](https://juliapomdp.github.io/POMDPs.jl/stable/def_pomdp/#Using-a-single-generative-function-instead-of-separate-T,-Z,-and-R) for further details.

Note: MDPs that implement the [POMDPs.jl explicit interface](http://juliapomdp.github.io/POMDPs.jl/stable/explicit/) can also be used with MCTS since the implementation of the explicit interface automatically defines the functions in the generative interface.
Note: MDPs that implement the [POMDPs.jl explicit interface](https://juliapomdp.github.io/POMDPs.jl/stable/def_pomdp/) can also be used with MCTS since the implementation of the explicit interface automatically defines the functions in the generative interface.

Once the above functions are defined, the solver can be called with the following syntax:

Expand Down
4 changes: 1 addition & 3 deletions src/MCTS.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
module MCTS

using POMDPs
using POMDPModelTools
using POMDPPolicies
using POMDPSimulators
using POMDPTools
using Random
using Printf
using ProgressMeter
Expand Down
2 changes: 1 addition & 1 deletion src/dpw.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ POMDPs.action(p::DPWPlanner, s) = first(action_info(p, s))
"""
Construct an MCTSDPW tree and choose the best action. Also output some information.
"""
function POMDPModelTools.action_info(p::DPWPlanner, s; tree_in_info=false)
function POMDPTools.action_info(p::DPWPlanner, s; tree_in_info=false)
local a::actiontype(p.mdp)
info = Dict{Symbol, Any}()
try
Expand Down
2 changes: 1 addition & 1 deletion src/vanilla.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ POMDPs.solve(solver::MCTSSolver, mdp::Union{POMDP,MDP}) = MCTSPlanner(solver, md
@subreq simulate(policy, state, policy.solver.depth)
end

function POMDPModelTools.action_info(p::AbstractMCTSPlanner, s)
function POMDPTools.action_info(p::AbstractMCTSPlanner, s)
tree = plan!(p, s)
best = best_sanode_Q(StateNode(tree, s))
return action(best), (tree=tree,)
Expand Down
10 changes: 0 additions & 10 deletions test/Project.toml

This file was deleted.

2 changes: 1 addition & 1 deletion test/benchmarks.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using POMDPs
using MCTS
using POMDPModels
using POMDPSimulators
using POMDPTools

# function POMDPs.simulate(mdp::POMDP,
# policy::Policy,
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using Test
using NBInclude
using D3Trees
using Random
using POMDPPolicies
using POMDPTools
using POMDPLinter: @requirements_info

n_iter = 50
Expand Down