{"action":"closed","issue":{"url":"https://api.github.com/repos/JuliaPOMDP/POMDPs.jl/issues/91","repository_url":"https://api.github.com/repos/JuliaPOMDP/POMDPs.jl","labels_url":"https://api.github.com/repos/JuliaPOMDP/POMDPs.jl/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/JuliaPOMDP/POMDPs.jl/issues/91/comments","events_url":"https://api.github.com/repos/JuliaPOMDP/POMDPs.jl/issues/91/events","html_url":"https://github.com/JuliaPOMDP/POMDPs.jl/issues/91","id":159740957,"number":91,"title":"Method Implementation Requirements for Solvers","user":{"login":"etotheipluspi","id":7054909,"avatar_url":"https://avatars.githubusercontent.com/u/7054909?v=3","gravatar_id":"","url":"https://api.github.com/users/etotheipluspi","html_url":"https://github.com/etotheipluspi","followers_url":"https://api.github.com/users/etotheipluspi/followers","following_url":"https://api.github.com/users/etotheipluspi/following{/other_user}","gists_url":"https://api.github.com/users/etotheipluspi/gists{/gist_id}","starred_url":"https://api.github.com/users/etotheipluspi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etotheipluspi/subscriptions","organizations_url":"https://api.github.com/users/etotheipluspi/orgs","repos_url":"https://api.github.com/users/etotheipluspi/repos","events_url":"https://api.github.com/users/etotheipluspi/events{/privacy}","received_events_url":"https://api.github.com/users/etotheipluspi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-06-10T23:21:40Z","updated_at":"2016-06-12T19:47:02Z","closed_at":"2016-06-12T19:47:02Z","body":"Right now we have no standardized way of telling the user what methods they need to implement (other than putting a list of them in the docs). I added a utility tool to POMDPs.jl that you can call like this:\r\n\r\n```julia\r\nPOMDPs.get_methods(function_list)\r\n```\r\nWhere `function_list` is a vector of function names that looks something like `function_list=[states, pdf, ...]`. \r\n\r\nI think it may be useful to have each solver implement something like a `required()` function that prints the methods that need to be implemented and their input arguments. See how I did this in [QMDP](https://github.com/JuliaPOMDP/QMDP.jl/blob/master/src/required.jl) using the above function. The user can do something like:\r\n\r\n```julia\r\nusing QMDP\r\nQMDP.required_methods()\r\n```\r\n\r\nOutput:\r\n\r\n```\r\n8-element Array{Method,1}:\r\n states{S,A}(problem::Union{POMDPs.MDP{S,A},POMDPs.POMDP{S,A,O}}, state::S, sts::POMDPs.AbstractSpace{S})                               \r\n actions{S,A}(problem::Union{POMDPs.MDP{S,A},POMDPs.POMDP{S,A,O}}, state::S, acts::POMDPs.AbstractSpace{A})                             \r\n iterator{T}(s::POMDPs.AbstractSpace{T})                                                                                                \r\n create_transition_distribution(problem::Union{POMDPs.MDP{S,A},POMDPs.POMDP{S,A,O}})                                                    \r\n transition{S,A}(problem::Union{POMDPs.MDP{S,A},POMDPs.POMDP{S,A,O}}, state::S, action::A, distribution::POMDPs.AbstractDistribution{S})\r\n reward{S,A}(problem::Union{POMDPs.MDP{S,A},POMDPs.POMDP{S,A,O}}, state::S, action::A)                                                  \r\n pdf{T}(d::POMDPs.AbstractDistribution{T}, x::T)                                                                                        \r\n state_index{S,A}(problem::Union{POMDPs.MDP{S,A},POMDPs.POMDP{S,A,O}}, s::S)      \r\n```\r\n\r\nThe way the method array gets generated is a bit awkward, so if you have a way of making it better please check out the function in utils.jl.\r\n\r\nTLDR; Please add a `Solver.required` method to your solver that calls `POMDPs.get_methods` on a vector of required functions for your solver. This will allow the user to check what functions they need to implement from the REPL. \r\n\r\nEdit: changed `required()` to `required_methods()` for future reference. "}}
{"actor":{"display_login":"etotheipluspi"}}