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

value does not work if called before action #83

Open
zsunberg opened this issue Aug 17, 2021 · 0 comments
Open

value does not work if called before action #83

zsunberg opened this issue Aug 17, 2021 · 0 comments

Comments

@zsunberg
Copy link
Member

This happens because value checks if the tree is not nothing in

if planner.tree == nothing
. Currently it is an empty tree, so it does not plan

julia> sol3 = solve(s3, m)

julia> value(sol3, states[4])
ERROR: State 0.06060606060606082 not present in MCTS tree.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] value(tr::MCTS.MCTSTree{Float64, Float64}, s::Float64)
   @ MCTS ~/.julia/dev/MCTS/src/vanilla.jl:217
 [3] value(planner::MCTSPlanner{QuickMDP{UUID("20287054-e7ba-4231-98f4-917124d65b0b"), Float64, Float64, NamedTuple{(:stateindex, :isterminal, :actionindex, :transition, :reward, :states, :actions, :discount), Tuple{Dict{Float64, Int64}, Bool, Dict{Float64, Int64}, var"#12#14", var"#13#15", StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, typeof(valid_actions), Float64}}}, Float64, Float64, MCTS.SolvedRolloutEstimator{POMDPPolicies.RandomPolicy{Random._GLOBAL_RNG, QuickMDP{UUID("20287054-e7ba-4231-98f4-917124d65b0b"), Float64, Float64, NamedTuple{(:stateindex, :isterminal, :actionindex, :transition, :reward, :states, :actions, :discount), Tuple{Dict{Float64, Int64}, Bool, Dict{Float64, Int64}, var"#12#14", var"#13#15", StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, typeof(valid_actions), Float64}}}, BeliefUpdaters.NothingUpdater}, Random._GLOBAL_RNG}, Random._GLOBAL_RNG}, s::Float64)
   @ MCTS ~/.julia/dev/MCTS/src/vanilla.jl:211
 [4] top-level scope
   @ REPL[61]:1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant