{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls/comments/218999848","pull_request_review_id":157065907,"id":218999848,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODk5OTg0OA==","diff_hunk":"@@ -0,0 +1,99 @@\n+const GWPos = SVector{2,Int}\n+\n+@with_kw struct SimpleGridWorld <: MDP{GWPos, Symbol}\n+    size::Tuple{Int, Int}           = (10,10)\n+    rewards::Dict{GWPos, Float64}   = Dict(GWPos(4,3)=>-10.0, GWPos(4,6)=>-5.0, GWPos(9,3)=>10.0, GWPos(8,8)=>3.0)\n+    terminate_in::Set{GWPos}        = Set((GWPos(4,3), GWPos(4,6), GWPos(9,3), GWPos(8,8)))\n+    tprob::Float64                  = 0.7\n+    discount::Float64               = 0.95\n+end\n+\n+\n+# States\n+\n+function POMDPs.states(mdp::SimpleGridWorld)\n+    ss = vec(GWPos[GWPos(x, y) for x in 1:mdp.size[1], y in 1:mdp.size[2]])\n+    push!(ss, GWPos(-1,-1))\n+    return ss\n+end\n+POMDPs.n_states(mdp::SimpleGridWorld) = prod(mdp.size) + 1\n+function POMDPs.stateindex(mdp::SimpleGridWorld, s::AbstractVector{Int})\n+    if all(s.>0)\n+        return LinearIndices(mdp.size)[s...]\n+    else\n+        return n_states(mdp)\n+    end\n+end\n+\n+POMDPs.initialstate(mdp::SimpleGridWorld, rng::AbstractRNG) = GWPos(rand(rng, 1:mdp.size[1]), rand(rng, 1:mdp.size[2]))\n+\n+\n+# Actions\n+\n+POMDPs.actions(mdp::SimpleGridWorld) = (:up, :down, :left, :right)\n+Base.rand(rng::AbstractRNG, t::NTuple{L,Symbol}) where L = t[rand(rng, 1:length(t))] # don't know why this doesn't work out of the box\n+POMDPs.n_actions(mdp::SimpleGridWorld) = 4\n+\n+const dir = Dict(:up=>GWPos(0,1), :down=>GWPos(0,-1), :left=>GWPos(-1,0), :right=>GWPos(1,0))\n+const aind = Dict(:up=>1, :down=>2, :left=>3, :right=>4)","path":"src/gridworld.jl","position":38,"original_position":38,"commit_id":"05ab2c18658b74cd6de0e9d139c8a87b49797158","original_commit_id":"eb032abb0cb07adb79f13b6c74337f32345e8c76","user":{"login":"MaximeBouton","id":11876271,"node_id":"MDQ6VXNlcjExODc2Mjcx","avatar_url":"https://avatars0.githubusercontent.com/u/11876271?v=4","gravatar_id":"","url":"https://api.github.com/users/MaximeBouton","html_url":"https://github.com/MaximeBouton","followers_url":"https://api.github.com/users/MaximeBouton/followers","following_url":"https://api.github.com/users/MaximeBouton/following{/other_user}","gists_url":"https://api.github.com/users/MaximeBouton/gists{/gist_id}","starred_url":"https://api.github.com/users/MaximeBouton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaximeBouton/subscriptions","organizations_url":"https://api.github.com/users/MaximeBouton/orgs","repos_url":"https://api.github.com/users/MaximeBouton/repos","events_url":"https://api.github.com/users/MaximeBouton/events{/privacy}","received_events_url":"https://api.github.com/users/MaximeBouton/received_events","type":"User","site_admin":false},"body":"minor style comment, I think `direction` instead of `dir`? \r\nI like all caps name for constant but this is personal maybe. ","created_at":"2018-09-19T23:57:36Z","updated_at":"2018-09-19T23:57:36Z","html_url":"https://github.com/JuliaPOMDP/POMDPModels.jl/pull/50#discussion_r218999848","pull_request_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls/50","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls/comments/218999848"},"html":{"href":"https://github.com/JuliaPOMDP/POMDPModels.jl/pull/50#discussion_r218999848"},"pull_request":{"href":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls/50","id":215752075,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1NzUyMDc1","html_url":"https://github.com/JuliaPOMDP/POMDPModels.jl/pull/50","diff_url":"https://github.com/JuliaPOMDP/POMDPModels.jl/pull/50.diff","patch_url":"https://github.com/JuliaPOMDP/POMDPModels.jl/pull/50.patch","issue_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/issues/50","number":50,"state":"open","locked":false,"title":"New gridworld","user":{"login":"zsunberg","id":4240491,"node_id":"MDQ6VXNlcjQyNDA0OTE=","avatar_url":"https://avatars3.githubusercontent.com/u/4240491?v=4","gravatar_id":"","url":"https://api.github.com/users/zsunberg","html_url":"https://github.com/zsunberg","followers_url":"https://api.github.com/users/zsunberg/followers","following_url":"https://api.github.com/users/zsunberg/following{/other_user}","gists_url":"https://api.github.com/users/zsunberg/gists{/gist_id}","starred_url":"https://api.github.com/users/zsunberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsunberg/subscriptions","organizations_url":"https://api.github.com/users/zsunberg/orgs","repos_url":"https://api.github.com/users/zsunberg/repos","events_url":"https://api.github.com/users/zsunberg/events{/privacy}","received_events_url":"https://api.github.com/users/zsunberg/received_events","type":"User","site_admin":false},"body":"This includes visualization, so waiting on JuliaPOMDP/POMDPModelTools#7 and https://github.com/GiovineItalia/Compose.jl/issues/297\r\n\r\nMaybe I will submit another PR without the visualization first.","created_at":"2018-09-15T05:53:36Z","updated_at":"2018-09-19T23:57:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9429dbc5e02158eebf328379816af7fb9f75b565","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls/50/commits","review_comments_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls/50/comments","review_comment_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/issues/50/comments","statuses_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/statuses/05ab2c18658b74cd6de0e9d139c8a87b49797158","head":{"label":"JuliaPOMDP:new_gridworld","ref":"new_gridworld","sha":"05ab2c18658b74cd6de0e9d139c8a87b49797158","user":{"login":"JuliaPOMDP","id":16347008,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MzQ3MDA4","avatar_url":"https://avatars3.githubusercontent.com/u/16347008?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaPOMDP","html_url":"https://github.com/JuliaPOMDP","followers_url":"https://api.github.com/users/JuliaPOMDP/followers","following_url":"https://api.github.com/users/JuliaPOMDP/following{/other_user}","gists_url":"https://api.github.com/users/JuliaPOMDP/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaPOMDP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaPOMDP/subscriptions","organizations_url":"https://api.github.com/users/JuliaPOMDP/orgs","repos_url":"https://api.github.com/users/JuliaPOMDP/repos","events_url":"https://api.github.com/users/JuliaPOMDP/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaPOMDP/received_events","type":"Organization","site_admin":false},"repo":{"id":39584817,"node_id":"MDEwOlJlcG9zaXRvcnkzOTU4NDgxNw==","name":"POMDPModels.jl","full_name":"JuliaPOMDP/POMDPModels.jl","private":false,"owner":{"login":"JuliaPOMDP","id":16347008,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MzQ3MDA4","avatar_url":"https://avatars3.githubusercontent.com/u/16347008?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaPOMDP","html_url":"https://github.com/JuliaPOMDP","followers_url":"https://api.github.com/users/JuliaPOMDP/followers","following_url":"https://api.github.com/users/JuliaPOMDP/following{/other_user}","gists_url":"https://api.github.com/users/JuliaPOMDP/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaPOMDP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaPOMDP/subscriptions","organizations_url":"https://api.github.com/users/JuliaPOMDP/orgs","repos_url":"https://api.github.com/users/JuliaPOMDP/repos","events_url":"https://api.github.com/users/JuliaPOMDP/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaPOMDP/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/JuliaPOMDP/POMDPModels.jl","description":"Problem models for testing POMDPs.jl","fork":false,"url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl","forks_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/forks","keys_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/teams","hooks_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/events","assignees_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/tags","blobs_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/subscription","commits_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/merges","archive_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/downloads","issues_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/deployments","created_at":"2015-07-23T18:38:27Z","updated_at":"2018-09-15T01:03:09Z","pushed_at":"2018-09-19T23:48:54Z","git_url":"git://github.com/JuliaPOMDP/POMDPModels.jl.git","ssh_url":"git@github.com:JuliaPOMDP/POMDPModels.jl.git","clone_url":"https://github.com/JuliaPOMDP/POMDPModels.jl.git","svn_url":"https://github.com/JuliaPOMDP/POMDPModels.jl","homepage":null,"size":377,"stargazers_count":8,"watchers_count":8,"language":"Jupyter Notebook","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":16,"open_issues":10,"watchers":8,"default_branch":"master"}},"base":{"label":"JuliaPOMDP:master","ref":"master","sha":"855c671f47ab5ce7d87df50693c720d3669b75e1","user":{"login":"JuliaPOMDP","id":16347008,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MzQ3MDA4","avatar_url":"https://avatars3.githubusercontent.com/u/16347008?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaPOMDP","html_url":"https://github.com/JuliaPOMDP","followers_url":"https://api.github.com/users/JuliaPOMDP/followers","following_url":"https://api.github.com/users/JuliaPOMDP/following{/other_user}","gists_url":"https://api.github.com/users/JuliaPOMDP/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaPOMDP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaPOMDP/subscriptions","organizations_url":"https://api.github.com/users/JuliaPOMDP/orgs","repos_url":"https://api.github.com/users/JuliaPOMDP/repos","events_url":"https://api.github.com/users/JuliaPOMDP/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaPOMDP/received_events","type":"Organization","site_admin":false},"repo":{"id":39584817,"node_id":"MDEwOlJlcG9zaXRvcnkzOTU4NDgxNw==","name":"POMDPModels.jl","full_name":"JuliaPOMDP/POMDPModels.jl","private":false,"owner":{"login":"JuliaPOMDP","id":16347008,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MzQ3MDA4","avatar_url":"https://avatars3.githubusercontent.com/u/16347008?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaPOMDP","html_url":"https://github.com/JuliaPOMDP","followers_url":"https://api.github.com/users/JuliaPOMDP/followers","following_url":"https://api.github.com/users/JuliaPOMDP/following{/other_user}","gists_url":"https://api.github.com/users/JuliaPOMDP/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaPOMDP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaPOMDP/subscriptions","organizations_url":"https://api.github.com/users/JuliaPOMDP/orgs","repos_url":"https://api.github.com/users/JuliaPOMDP/repos","events_url":"https://api.github.com/users/JuliaPOMDP/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaPOMDP/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/JuliaPOMDP/POMDPModels.jl","description":"Problem models for testing POMDPs.jl","fork":false,"url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl","forks_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/forks","keys_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/teams","hooks_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/events","assignees_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/tags","blobs_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/subscription","commits_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/merges","archive_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/downloads","issues_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/deployments","created_at":"2015-07-23T18:38:27Z","updated_at":"2018-09-15T01:03:09Z","pushed_at":"2018-09-19T23:48:54Z","git_url":"git://github.com/JuliaPOMDP/POMDPModels.jl.git","ssh_url":"git@github.com:JuliaPOMDP/POMDPModels.jl.git","clone_url":"https://github.com/JuliaPOMDP/POMDPModels.jl.git","svn_url":"https://github.com/JuliaPOMDP/POMDPModels.jl","homepage":null,"size":377,"stargazers_count":8,"watchers_count":8,"language":"Jupyter Notebook","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":16,"open_issues":10,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls/50"},"html":{"href":"https://github.com/JuliaPOMDP/POMDPModels.jl/pull/50"},"issue":{"href":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/issues/50"},"comments":{"href":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaPOMDP/POMDPModels.jl/statuses/05ab2c18658b74cd6de0e9d139c8a87b49797158"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"MaximeBouton"}}