Comments (3)
Hey! Your original post and subsequent edit highlight the issue. The solve function is defined in POMCPOW so when you don't use that package/module, you will get this error.
from vdptag2.jl.
I understand now, thank you!
But there is another problem when I try to use discrete VDPTag.
The code is:
using POMDPs
using BasicPOMCP
using POMDPModels
using POMDPSimulators
using POMDPPolicies
using VDPTag2
solver = POMCPSolver()
pomdp = VDPTagPOMDP()
dpomdp = AODiscreteVDPTagPOMDP()
planner = solve(solver, dpomdp)
hr = HistoryRecorder(max_steps=100)
hist = simulate(hr, dpomdp , planner)
for (s, b, a, r, sp, o) in hist
@show s, a, r, sp
end
rhist = simulate(hr, pomdp, RandomPolicy(pomdp))
println("""
Cumulative Discounted Reward (for 1 simulation)
Random: $(discounted_reward(rhist))
POMCPOW: $(discounted_reward(hist))
""")
The error message says:
ERROR: UndefVarError: action_type not defined
Stacktrace:
[1] gen(::AODiscreteVDPTagPOMDP, ::TagState, ::Int64, ::Random._GLOBAL_RNG) at /home/fengliu/.julia/packages/VDPTag2/k24dR/src/discretized.jl:81
[2] macro expansion at /home/fengliu/.julia/packages/POMDPs/XDCTo/src/gen_impl.jl:30 [inlined]
[3] macro expansion at ./none:0 [inlined]
[4] genout(::DDNOut{(:sp, :o)}, ::DDNStructure{NamedTuple{(:s, :a, :sp, :o, :r),Tuple{InputDDNNode,InputDDNNode,DistributionDDNNode{typeof(transition)},DistributionDDNNode{typeof(observation)},FunctionDDNNode{typeof(reward)}}},NamedTuple{(:s, :a, :sp, :o, :r),Tuple{Tuple{},Tuple{},Tuple{DDNNode{:s},DDNNode{:a}},Tuple{DDNNode{:s},DDNNode{:a},DDNNode{:sp}},Tuple{DDNNode{:s},DDNNode{:a},DDNNode{:sp},DDNNode{:o}}}}}, ::AODiscreteVDPTagPOMDP, ::TagState, ::Int64, ::Random._GLOBAL_RNG) at ./none:0
[5] macro expansion at /home/fengliu/.julia/packages/POMDPs/XDCTo/src/gen_impl.jl:19 [inlined]
[6] gen(::DDNOut{(:sp, :o)}, ::AODiscreteVDPTagPOMDP, ::TagState, ::Int64, ::Random._GLOBAL_RNG) at /home/fengliu/.julia/packages/POMDPs/XDCTo/src/gen_impl.jl:4
[7] update(::ParticleFilters.UnweightedParticleFilter{AODiscreteVDPTagPOMDP,Random._GLOBAL_RNG}, ::ParticleFilters.ParticleCollection{TagState}, ::Int64, ::StaticArrays.SArray{Tuple{8},Int64,1,8}) at /home/fengliu/.julia/packages/ParticleFilters/ixWxo/src/unweighted.jl:21
[8] update_info(::ParticleFilters.UnweightedParticleFilter{AODiscreteVDPTagPOMDP,Random._GLOBAL_RNG}, ::ParticleFilters.ParticleCollection{TagState}, ::Int64, ::StaticArrays.SArray{Tuple{8},Int64,1,8}) at /home/fengliu/.julia/packages/POMDPModelTools/R58YX/src/info.jl:34
[9] iterate(::POMDPSimulators.POMDPSimIterator{(:s, :a, :sp, :o, :r, :t, :action_info, :b, :bp, :update_info),AODiscreteVDPTagPOMDP,POMCPPlanner{AODiscreteVDPTagPOMDP,BasicPOMCP.SolvedPORollout{RandomPolicy{Random._GLOBAL_RNG,AODiscreteVDPTagPOMDP,BeliefUpdaters.NothingUpdater},BeliefUpdaters.NothingUpdater,Random._GLOBAL_RNG},Random._GLOBAL_RNG},ParticleFilters.UnweightedParticleFilter{AODiscreteVDPTagPOMDP,Random._GLOBAL_RNG},Random._GLOBAL_RNG,ParticleFilters.ParticleCollection{TagState},TagState}, ::Tuple{Int64,TagState,ParticleFilters.ParticleCollection{TagState}}) at /home/fengliu/.julia/packages/POMDPSimulators/4scij/src/stepthrough.jl:96
[10] iterate at /home/fengliu/.julia/packages/POMDPSimulators/4scij/src/stepthrough.jl:86 [inlined]
[11] _collect(::UnitRange{Int64}, ::POMDPSimulators.POMDPSimIterator{(:s, :a, :sp, :o, :r, :t, :action_info, :b, :bp, :update_info),AODiscreteVDPTagPOMDP,POMCPPlanner{AODiscreteVDPTagPOMDP,BasicPOMCP.SolvedPORollout{RandomPolicy{Random._GLOBAL_RNG,AODiscreteVDPTagPOMDP,BeliefUpdaters.NothingUpdater},BeliefUpdaters.NothingUpdater,Random._GLOBAL_RNG},Random._GLOBAL_RNG},ParticleFilters.UnweightedParticleFilter{AODiscreteVDPTagPOMDP,Random._GLOBAL_RNG},Random._GLOBAL_RNG,ParticleFilters.ParticleCollection{TagState},TagState}, ::Base.HasEltype, ::Base.SizeUnknown) at ./array.jl:571
[12] collect at ./array.jl:560 [inlined]
[13] collect_history(::POMDPSimulators.POMDPSimIterator{(:s, :a, :sp, :o, :r, :t, :action_info, :b, :bp, :update_info),AODiscreteVDPTagPOMDP,POMCPPlanner{AODiscreteVDPTagPOMDP,BasicPOMCP.SolvedPORollout{RandomPolicy{Random._GLOBAL_RNG,AODiscreteVDPTagPOMDP,BeliefUpdaters.NothingUpdater},BeliefUpdaters.NothingUpdater,Random._GLOBAL_RNG},Random._GLOBAL_RNG},ParticleFilters.UnweightedParticleFilter{AODiscreteVDPTagPOMDP,Random._GLOBAL_RNG},Random._GLOBAL_RNG,ParticleFilters.ParticleCollection{TagState},TagState}, ::Val{false}, ::Nothing) at /home/fengliu/.julia/packages/POMDPSimulators/4scij/src/history_recorder.jl:185
[14] simulate(::HistoryRecorder, ::AODiscreteVDPTagPOMDP, ::POMCPPlanner{AODiscreteVDPTagPOMDP,BasicPOMCP.SolvedPORollout{RandomPolicy{Random._GLOBAL_RNG,AODiscreteVDPTagPOMDP,BeliefUpdaters.NothingUpdater},BeliefUpdaters.NothingUpdater,Random._GLOBAL_RNG},Random._GLOBAL_RNG}, ::ParticleFilters.UnweightedParticleFilter{AODiscreteVDPTagPOMDP,Random._GLOBAL_RNG}, ::VDPTag2.VDPInitDist, ::TagState) at /home/fengliu/.julia/packages/POMDPSimulators/4scij/src/history_recorder.jl:109
[15] simulate(::HistoryRecorder, ::AODiscreteVDPTagPOMDP, ::POMCPPlanner{AODiscreteVDPTagPOMDP,BasicPOMCP.SolvedPORollout{RandomPolicy{Random._GLOBAL_RNG,AODiscreteVDPTagPOMDP,BeliefUpdaters.NothingUpdater},BeliefUpdaters.NothingUpdater,Random._GLOBAL_RNG},Random._GLOBAL_RNG}, ::ParticleFilters.UnweightedParticleFilter{AODiscreteVDPTagPOMDP,Random._GLOBAL_RNG}, ::VDPTag2.VDPInitDist) at /home/fengliu/.julia/packages/POMDPSimulators/4scij/src/history_recorder.jl:85
[16] simulate at /home/fengliu/.julia/packages/POMDPSimulators/4scij/src/history_recorder.jl:59 [inlined]
[17] simulate(::HistoryRecorder, ::AODiscreteVDPTagPOMDP, ::POMCPPlanner{AODiscreteVDPTagPOMDP,BasicPOMCP.SolvedPORollout{RandomPolicy{Random._GLOBAL_RNG,AODiscreteVDPTagPOMDP,BeliefUpdaters.NothingUpdater},BeliefUpdaters.NothingUpdater,Random._GLOBAL_RNG},Random._GLOBAL_RNG}) at /home/fengliu/.julia/packages/POMDPSimulators/4scij/src/history_recorder.jl:58
[18] top-level scope at REPL[13]:1
@logankilpatrick
If the problem is still my code, would you please notice me how to apply discrete VDPTag to POMCP correctly. This problem has disturbed me for a long time. Thank you very much!
from vdptag2.jl.
@CharlieLei, Sorry I let this slip through the cracks! It is fixed now
from vdptag2.jl.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vdptag2.jl.