_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: https://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.6.0 (2017-06-19 13:05 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-apple-darwin13.4.0
julia> include("Powseeker.jl")
WARNING: deprecated syntax "typealias PowseekerProblem Union{PowseekerMDP,PowseekerPOMDP}" at /Users/jacquesdechalendar/Box Sync/Stanford Ed/AA228/project/gallery/Powseeker.jl/src/Powseeker.jl:94.
Use "const PowseekerProblem = Union{PowseekerMDP,PowseekerPOMDP}" instead.
Powseeker
julia> using Powseeker
julia> using POMDPToolbox
julia> using POMDPs
julia> using QMDP
julia> @requirements_info QMDPSolver() Powseeker
Powseeker PowseekerMDP PowseekerPOMDP
julia> @requirements_info QMDPSolver() PowseekerPOMDP()
INFO: POMDPs.jl requirements for solve(::QMDPSolver, ::POMDPs.POMDP) and dependencies. ([✔] = implemented correctly; [X] = missing)
For solve(::QMDPSolver, ::POMDPs.POMDP):
[No additional requirements]
For solve(::ValueIterationSolver, ::Union{POMDPs.MDP,POMDPs.POMDP}) (in solve(::QMDPSolver, ::POMDPs.POMDP)):
[✔] discount(::PowseekerPOMDP)
[X] n_states(::PowseekerPOMDP)
[X] n_actions(::PowseekerPOMDP)
[X] transition(::PowseekerPOMDP, ::SkierState, ::GPSOrAngle)
[X] reward(::PowseekerPOMDP, ::SkierState, ::GPSOrAngle, ::SkierState)
[X] state_index(::PowseekerPOMDP, ::SkierState)
[X] action_index(::PowseekerPOMDP, ::GPSOrAngle)
[✔] actions(::PowseekerPOMDP, ::SkierState)
WARNING: Some requirements may not be shown because a MethodError was thrown.
For ordered_states(::Union{POMDPs.MDP,POMDPs.POMDP}) (in solve(::ValueIterationSolver, ::Union{POMDPs.MDP,POMDPs.POMDP})):
[X] states(::PowseekerPOMDP)
WARNING: Some requirements may not be shown because a MethodError was thrown.
For ordered_actions(::Union{POMDPs.MDP,POMDPs.POMDP}) (in solve(::ValueIterationSolver, ::Union{POMDPs.MDP,POMDPs.POMDP})):
[✔] actions(::PowseekerPOMDP)
[X] iterator(::GPSOrAngleSpace)
Note: Missing methods are often due to incorrect importing. Consider using `importall POMDPs`.
Throwing the first exception (from processing solve(::ValueIterationSolver, ::Union{POMDPs.MDP,POMDPs.POMDP}) requirements):
ERROR: MethodError: no method matching states(::Powseeker.PowseekerPOMDP{Powseeker.#grad_scaled_peaks2})
Closest candidates are:
states(::Union{POMDPs.MDP, POMDPs.POMDP}, ::Any) at /Users/jacquesdechalendar/.julia/v0.6/POMDPs/src/space.jl:26
states(::POMDPs.MDP{Bool,A} where A) at /Users/jacquesdechalendar/.julia/v0.6/POMDPToolbox/src/convenience/implementations.jl:21
states(::POMDPs.POMDP{Bool,A,O} where O where A) at /Users/jacquesdechalendar/.julia/v0.6/POMDPToolbox/src/convenience/implementations.jl:22
Stacktrace:
[1] macro expansion at /Users/jacquesdechalendar/.julia/v0.6/DiscreteValueIteration/src/vanilla.jl:95 [inlined]
[2] macro expansion at /Users/jacquesdechalendar/.julia/v0.6/POMDPs/src/requirements_internals.jl:51 [inlined]
[3] get_requirements(::POMDPs.#solve, ::Tuple{DiscreteValueIteration.ValueIterationSolver,Powseeker.PowseekerPOMDP{Powseeker.#grad_scaled_peaks2}}) at /Users/jacquesdechalendar/.julia/v0.6/POMDPs/src/requirements_interface.jl:62
[4] macro expansion at /Users/jacquesdechalendar/.julia/v0.6/QMDP/src/vanilla.jl:53 [inlined]
[5] macro expansion at /Users/jacquesdechalendar/.julia/v0.6/POMDPs/src/requirements_internals.jl:51 [inlined]
[6] get_requirements(::POMDPs.#solve, ::Tuple{QMDP.QMDPSolver,Powseeker.PowseekerPOMDP{Powseeker.#grad_scaled_peaks2}}) at /Users/jacquesdechalendar/.julia/v0.6/POMDPs/src/requirements_interface.jl:62
[7] requirements_info(::QMDP.QMDPSolver, ::Powseeker.PowseekerPOMDP{Powseeker.#grad_scaled_peaks2}) at /Users/jacquesdechalendar/.julia/v0.6/POMDPs/src/requirements_interface.jl:140
julia>
In that case, is there a shadow to the requirements macro that tells you what solvers can be used with a given problem implementation?
I thought the general workflow was to first think about the problem and how best to write it, and only think about solvers in a second step. In other words, that problem formulation/modeling was separate from problem resolution. Is the correct workflow to instead choose a solver (or set of solvers) and then write the problem such that it fits those solvers?