{"action":"closed","number":8,"pull_request":{"url":"https://api.github.com/repos/NetLogo/Rnd-Extension/pulls/8","id":57415272,"html_url":"https://github.com/NetLogo/Rnd-Extension/pull/8","diff_url":"https://github.com/NetLogo/Rnd-Extension/pull/8.diff","patch_url":"https://github.com/NetLogo/Rnd-Extension/pull/8.patch","issue_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/issues/8","number":8,"state":"closed","locked":false,"title":"Separate agentset and list primitives","user":{"login":"nicolaspayette","id":908754,"avatar_url":"https://avatars.githubusercontent.com/u/908754?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolaspayette","html_url":"https://github.com/nicolaspayette","followers_url":"https://api.github.com/users/nicolaspayette/followers","following_url":"https://api.github.com/users/nicolaspayette/following{/other_user}","gists_url":"https://api.github.com/users/nicolaspayette/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolaspayette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolaspayette/subscriptions","organizations_url":"https://api.github.com/users/nicolaspayette/orgs","repos_url":"https://api.github.com/users/nicolaspayette/repos","events_url":"https://api.github.com/users/nicolaspayette/events{/privacy}","received_events_url":"https://api.github.com/users/nicolaspayette/received_events","type":"User","site_admin":false},"body":"To address #5, we now provide separate sets of primitives for selecting agents out of an agentset and items out of a list. This means that the old awkward syntax for selecting an agent:\r\n```\r\nrnd:weighted-one-of turtles [ [ size ] of ? ]\r\n```\r\n...is now replaced by the much nicer:\r\n```\r\nrnd:weighted-one-of turtles [ size ]\r\n```\r\nTo select an item from a list, you now need to use one of the new `-list` primitives:\r\n```\r\nrnd:weighted-one-of-list [ 1 2 3 4 5 ] [ ? ]\r\n```\r\nThis breaks backward compatibility, but seems worth it since multiple people have been stumped by the old syntax.\r\n\r\nHere is the new set of primitives:\r\n\r\n|                             | From an AgentSet                 | From a List                           |\r\n|-----------------------------|----------------------------------|---------------------------------------|\r\n| One item                    | `rnd:weighted-one-of`            | `rnd:weighted-one-of-list`            |\r\n| Many items, without repeats | `rnd:weighted-n-of`              | `rnd:weighted-n-of-list`              |\r\n| Many items, with repeats    | `rnd:weighted-n-of-with-repeats` | `rnd:weighted-n-of-list-with-repeats` |\r\n\r\nI would appreciate if anyone has a moment a moment to [look at the new documentation](https://github.com/NetLogo/Rnd-Extension/blob/issue-5/README.md) and tell me what they think. (@BruceEdmonds, @jbadham, amongst others, you have both used the extension and I'd value your opinions.)\r\n\r\nTwo questions that are still (somewhat) open:\r\n\r\n- Are these the right names for the new primitives?\r\n\r\n  I'm assuming the agentset case will be by far the most frequent, so it makes sense to keep the shorter names for it, but maybe someone can come up with better names for the `-list` primitives (or a new scheme altogether!)\r\n\r\n- Should \"with repeats\" be a parameter instead of a separate primitive?\r\n\r\n  I think that \"_without_ repeats\" is the most common case, but I'm not entirely sure. If it was a parameter, you'd have to provide it all the time, which could be annoying. The two primitives also have different return types: list for \"with repeats\", agentset for \"without repeats\". Keeping them separate allows NetLogo to detect misuse at compile time instead of runtime.","created_at":"2016-01-27T20:10:42Z","updated_at":"2016-02-15T23:07:54Z","closed_at":"2016-02-15T23:07:54Z","merged_at":"2016-02-15T23:07:54Z","merge_commit_sha":"9fd006179bb98de5fcaa2cf7fe6863d261810234","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/pulls/8/commits","review_comments_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/pulls/8/comments","review_comment_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/issues/8/comments","statuses_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/statuses/6ae2327b5e1de12270e6265187dca0e5e8cab784","head":{"label":"NetLogo:issue-5","ref":"issue-5","sha":"6ae2327b5e1de12270e6265187dca0e5e8cab784","user":{"login":"NetLogo","id":767367,"avatar_url":"https://avatars.githubusercontent.com/u/767367?v=3","gravatar_id":"","url":"https://api.github.com/users/NetLogo","html_url":"https://github.com/NetLogo","followers_url":"https://api.github.com/users/NetLogo/followers","following_url":"https://api.github.com/users/NetLogo/following{/other_user}","gists_url":"https://api.github.com/users/NetLogo/gists{/gist_id}","starred_url":"https://api.github.com/users/NetLogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NetLogo/subscriptions","organizations_url":"https://api.github.com/users/NetLogo/orgs","repos_url":"https://api.github.com/users/NetLogo/repos","events_url":"https://api.github.com/users/NetLogo/events{/privacy}","received_events_url":"https://api.github.com/users/NetLogo/received_events","type":"Organization","site_admin":false},"repo":{"id":12330670,"name":"Rnd-Extension","full_name":"NetLogo/Rnd-Extension","owner":{"login":"NetLogo","id":767367,"avatar_url":"https://avatars.githubusercontent.com/u/767367?v=3","gravatar_id":"","url":"https://api.github.com/users/NetLogo","html_url":"https://github.com/NetLogo","followers_url":"https://api.github.com/users/NetLogo/followers","following_url":"https://api.github.com/users/NetLogo/following{/other_user}","gists_url":"https://api.github.com/users/NetLogo/gists{/gist_id}","starred_url":"https://api.github.com/users/NetLogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NetLogo/subscriptions","organizations_url":"https://api.github.com/users/NetLogo/orgs","repos_url":"https://api.github.com/users/NetLogo/repos","events_url":"https://api.github.com/users/NetLogo/events{/privacy}","received_events_url":"https://api.github.com/users/NetLogo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NetLogo/Rnd-Extension","description":"This extension adds primitives for doing weighted random selection in NetLogo.","fork":false,"url":"https://api.github.com/repos/NetLogo/Rnd-Extension","forks_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/forks","keys_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/teams","hooks_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/hooks","issue_events_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/issues/events{/number}","events_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/events","assignees_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/assignees{/user}","branches_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/branches{/branch}","tags_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/tags","blobs_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/statuses/{sha}","languages_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/languages","stargazers_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/stargazers","contributors_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/contributors","subscribers_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/subscribers","subscription_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/subscription","commits_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/contents/{+path}","compare_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/merges","archive_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/downloads","issues_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/issues{/number}","pulls_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/pulls{/number}","milestones_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/milestones{/number}","notifications_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/labels{/name}","releases_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/releases{/id}","deployments_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/deployments","created_at":"2013-08-23T19:14:08Z","updated_at":"2016-01-15T18:52:51Z","pushed_at":"2016-02-15T23:07:54Z","git_url":"git://github.com/NetLogo/Rnd-Extension.git","ssh_url":"git@github.com:NetLogo/Rnd-Extension.git","clone_url":"https://github.com/NetLogo/Rnd-Extension.git","svn_url":"https://github.com/NetLogo/Rnd-Extension","homepage":"","size":48,"stargazers_count":1,"watchers_count":1,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"NetLogo:master","ref":"master","sha":"1b94bad5eb4cc00badcfa26d7edc0850ae21e236","user":{"login":"NetLogo","id":767367,"avatar_url":"https://avatars.githubusercontent.com/u/767367?v=3","gravatar_id":"","url":"https://api.github.com/users/NetLogo","html_url":"https://github.com/NetLogo","followers_url":"https://api.github.com/users/NetLogo/followers","following_url":"https://api.github.com/users/NetLogo/following{/other_user}","gists_url":"https://api.github.com/users/NetLogo/gists{/gist_id}","starred_url":"https://api.github.com/users/NetLogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NetLogo/subscriptions","organizations_url":"https://api.github.com/users/NetLogo/orgs","repos_url":"https://api.github.com/users/NetLogo/repos","events_url":"https://api.github.com/users/NetLogo/events{/privacy}","received_events_url":"https://api.github.com/users/NetLogo/received_events","type":"Organization","site_admin":false},"repo":{"id":12330670,"name":"Rnd-Extension","full_name":"NetLogo/Rnd-Extension","owner":{"login":"NetLogo","id":767367,"avatar_url":"https://avatars.githubusercontent.com/u/767367?v=3","gravatar_id":"","url":"https://api.github.com/users/NetLogo","html_url":"https://github.com/NetLogo","followers_url":"https://api.github.com/users/NetLogo/followers","following_url":"https://api.github.com/users/NetLogo/following{/other_user}","gists_url":"https://api.github.com/users/NetLogo/gists{/gist_id}","starred_url":"https://api.github.com/users/NetLogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NetLogo/subscriptions","organizations_url":"https://api.github.com/users/NetLogo/orgs","repos_url":"https://api.github.com/users/NetLogo/repos","events_url":"https://api.github.com/users/NetLogo/events{/privacy}","received_events_url":"https://api.github.com/users/NetLogo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NetLogo/Rnd-Extension","description":"This extension adds primitives for doing weighted random selection in NetLogo.","fork":false,"url":"https://api.github.com/repos/NetLogo/Rnd-Extension","forks_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/forks","keys_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/teams","hooks_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/hooks","issue_events_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/issues/events{/number}","events_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/events","assignees_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/assignees{/user}","branches_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/branches{/branch}","tags_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/tags","blobs_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/statuses/{sha}","languages_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/languages","stargazers_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/stargazers","contributors_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/contributors","subscribers_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/subscribers","subscription_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/subscription","commits_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/contents/{+path}","compare_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/merges","archive_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/downloads","issues_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/issues{/number}","pulls_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/pulls{/number}","milestones_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/milestones{/number}","notifications_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/labels{/name}","releases_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/releases{/id}","deployments_url":"https://api.github.com/repos/NetLogo/Rnd-Extension/deployments","created_at":"2013-08-23T19:14:08Z","updated_at":"2016-01-15T18:52:51Z","pushed_at":"2016-02-15T23:07:54Z","git_url":"git://github.com/NetLogo/Rnd-Extension.git","ssh_url":"git@github.com:NetLogo/Rnd-Extension.git","clone_url":"https://github.com/NetLogo/Rnd-Extension.git","svn_url":"https://github.com/NetLogo/Rnd-Extension","homepage":"","size":48,"stargazers_count":1,"watchers_count":1,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NetLogo/Rnd-Extension/pulls/8"},"html":{"href":"https://github.com/NetLogo/Rnd-Extension/pull/8"},"issue":{"href":"https://api.github.com/repos/NetLogo/Rnd-Extension/issues/8"},"comments":{"href":"https://api.github.com/repos/NetLogo/Rnd-Extension/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/NetLogo/Rnd-Extension/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/NetLogo/Rnd-Extension/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NetLogo/Rnd-Extension/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/NetLogo/Rnd-Extension/statuses/6ae2327b5e1de12270e6265187dca0e5e8cab784"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"nicolaspayette","id":908754,"avatar_url":"https://avatars.githubusercontent.com/u/908754?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolaspayette","html_url":"https://github.com/nicolaspayette","followers_url":"https://api.github.com/users/nicolaspayette/followers","following_url":"https://api.github.com/users/nicolaspayette/following{/other_user}","gists_url":"https://api.github.com/users/nicolaspayette/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolaspayette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolaspayette/subscriptions","organizations_url":"https://api.github.com/users/nicolaspayette/orgs","repos_url":"https://api.github.com/users/nicolaspayette/repos","events_url":"https://api.github.com/users/nicolaspayette/events{/privacy}","received_events_url":"https://api.github.com/users/nicolaspayette/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"commits":4,"additions":326,"deletions":174,"changed_files":4}}