{"action":"created","comment":{"url":"https://api.github.com/repos/jeromekelleher/discsim/pulls/comments/35858759","id":35858759,"diff_hunk":"@@ -1181,7 +1247,102 @@ sim_simulate(sim_t *self, uint64_t max_events)\n     return ret;\n }\n \n+int\n+sim_simulate_arg(sim_t *self) \n+{\n+    int ret = 0;\n+    double recomb_rate, coal_rate, total_rate; \n+    individual_t **S = self->intersected_buffer;\n+    unsigned int S_size = 0;\n+    avl_node_t *node;\n+    uintptr_t int_ptr;\n+    uint64_t id;\n+    individual_t *ind;\n+    /* An arbitrary radius and parental location for using existing spatial \n+     * functions to complete events */\n+    double z[] = {self->pixel_size / 2.0, self->pixel_size / 2.0}, r = self->pixel_size / 4.0;","path":"lib/sim.c","position":242,"original_position":242,"commit_id":"fdc2695128546216769f0366cfa7310588f98572","original_commit_id":"fdc2695128546216769f0366cfa7310588f98572","user":{"login":"jeromekelleher","id":2664569,"avatar_url":"https://avatars.githubusercontent.com/u/2664569?v=3","gravatar_id":"","url":"https://api.github.com/users/jeromekelleher","html_url":"https://github.com/jeromekelleher","followers_url":"https://api.github.com/users/jeromekelleher/followers","following_url":"https://api.github.com/users/jeromekelleher/following{/other_user}","gists_url":"https://api.github.com/users/jeromekelleher/gists{/gist_id}","starred_url":"https://api.github.com/users/jeromekelleher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeromekelleher/subscriptions","organizations_url":"https://api.github.com/users/jeromekelleher/orgs","repos_url":"https://api.github.com/users/jeromekelleher/repos","events_url":"https://api.github.com/users/jeromekelleher/events{/privacy}","received_events_url":"https://api.github.com/users/jeromekelleher/received_events","type":"User","site_admin":false},"body":"In the existing declarations we have\r\n```\r\n","created_at":"2015-07-30T10:46:47Z","updated_at":"2015-07-30T10:46:47Z","html_url":"https://github.com/jeromekelleher/discsim/pull/1#discussion_r35858759","pull_request_url":"https://api.github.com/repos/jeromekelleher/discsim/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/jeromekelleher/discsim/pulls/comments/35858759"},"html":{"href":"https://github.com/jeromekelleher/discsim/pull/1#discussion_r35858759"},"pull_request":{"href":"https://api.github.com/repos/jeromekelleher/discsim/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/jeromekelleher/discsim/pulls/1","id":40752556,"html_url":"https://github.com/jeromekelleher/discsim/pull/1","diff_url":"https://github.com/jeromekelleher/discsim/pull/1.diff","patch_url":"https://github.com/jeromekelleher/discsim/pull/1.patch","issue_url":"https://api.github.com/repos/jeromekelleher/discsim/issues/1","number":1,"state":"open","locked":false,"title":"Kingman prototype","user":{"login":"JereKoskela","id":6280602,"avatar_url":"https://avatars.githubusercontent.com/u/6280602?v=3","gravatar_id":"","url":"https://api.github.com/users/JereKoskela","html_url":"https://github.com/JereKoskela","followers_url":"https://api.github.com/users/JereKoskela/followers","following_url":"https://api.github.com/users/JereKoskela/following{/other_user}","gists_url":"https://api.github.com/users/JereKoskela/gists{/gist_id}","starred_url":"https://api.github.com/users/JereKoskela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JereKoskela/subscriptions","organizations_url":"https://api.github.com/users/JereKoskela/orgs","repos_url":"https://api.github.com/users/JereKoskela/repos","events_url":"https://api.github.com/users/JereKoskela/events{/privacy}","received_events_url":"https://api.github.com/users/JereKoskela/received_events","type":"User","site_admin":false},"body":"Two new functions:\r\n\r\n- sim_setup_arg uses 1 child, 1 parent jumps to move all lineages to a single pixel. Spatial parameters and a virtual event location are overwritten so that lineages can only intersect with a single pixel, and are unable to migrate out.\r\n\r\n- sim_simulate_arg simulates the arg phase using the two types of transitions we discussed: 2 children, one parent for a merger and 1 child, two parents for a recombination. The different recombination mechanism in the ARG has led to some changes to the sim_generate_parents function, and spatial locations are still set so that every lineage intersects with one single pixel only.\r\n\r\nI've tried some trial simulations with small numbers of lineages and both few and many loci, and everything looks good. Valgrind also reports no memory leaks. But I haven't done extensive testing, which would probably be easier with a Python wrapper.","created_at":"2015-07-24T08:22:34Z","updated_at":"2015-07-30T10:46:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d43925522074ee0619496cfc116ccc394bc06f5d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jeromekelleher/discsim/pulls/1/commits","review_comments_url":"https://api.github.com/repos/jeromekelleher/discsim/pulls/1/comments","review_comment_url":"https://api.github.com/repos/jeromekelleher/discsim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jeromekelleher/discsim/issues/1/comments","statuses_url":"https://api.github.com/repos/jeromekelleher/discsim/statuses/fdc2695128546216769f0366cfa7310588f98572","head":{"label":"JereKoskela:master","ref":"master","sha":"fdc2695128546216769f0366cfa7310588f98572","user":{"login":"JereKoskela","id":6280602,"avatar_url":"https://avatars.githubusercontent.com/u/6280602?v=3","gravatar_id":"","url":"https://api.github.com/users/JereKoskela","html_url":"https://github.com/JereKoskela","followers_url":"https://api.github.com/users/JereKoskela/followers","following_url":"https://api.github.com/users/JereKoskela/following{/other_user}","gists_url":"https://api.github.com/users/JereKoskela/gists{/gist_id}","starred_url":"https://api.github.com/users/JereKoskela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JereKoskela/subscriptions","organizations_url":"https://api.github.com/users/JereKoskela/orgs","repos_url":"https://api.github.com/users/JereKoskela/repos","events_url":"https://api.github.com/users/JereKoskela/events{/privacy}","received_events_url":"https://api.github.com/users/JereKoskela/received_events","type":"User","site_admin":false},"repo":{"id":37993348,"name":"discsim","full_name":"JereKoskela/discsim","owner":{"login":"JereKoskela","id":6280602,"avatar_url":"https://avatars.githubusercontent.com/u/6280602?v=3","gravatar_id":"","url":"https://api.github.com/users/JereKoskela","html_url":"https://github.com/JereKoskela","followers_url":"https://api.github.com/users/JereKoskela/followers","following_url":"https://api.github.com/users/JereKoskela/following{/other_user}","gists_url":"https://api.github.com/users/JereKoskela/gists{/gist_id}","starred_url":"https://api.github.com/users/JereKoskela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JereKoskela/subscriptions","organizations_url":"https://api.github.com/users/JereKoskela/orgs","repos_url":"https://api.github.com/users/JereKoskela/repos","events_url":"https://api.github.com/users/JereKoskela/events{/privacy}","received_events_url":"https://api.github.com/users/JereKoskela/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JereKoskela/discsim","description":"Efficient coalescent simulations in a spatial continuum","fork":true,"url":"https://api.github.com/repos/JereKoskela/discsim","forks_url":"https://api.github.com/repos/JereKoskela/discsim/forks","keys_url":"https://api.github.com/repos/JereKoskela/discsim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JereKoskela/discsim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JereKoskela/discsim/teams","hooks_url":"https://api.github.com/repos/JereKoskela/discsim/hooks","issue_events_url":"https://api.github.com/repos/JereKoskela/discsim/issues/events{/number}","events_url":"https://api.github.com/repos/JereKoskela/discsim/events","assignees_url":"https://api.github.com/repos/JereKoskela/discsim/assignees{/user}","branches_url":"https://api.github.com/repos/JereKoskela/discsim/branches{/branch}","tags_url":"https://api.github.com/repos/JereKoskela/discsim/tags","blobs_url":"https://api.github.com/repos/JereKoskela/discsim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JereKoskela/discsim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JereKoskela/discsim/git/refs{/sha}","trees_url":"https://api.github.com/repos/JereKoskela/discsim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JereKoskela/discsim/statuses/{sha}","languages_url":"https://api.github.com/repos/JereKoskela/discsim/languages","stargazers_url":"https://api.github.com/repos/JereKoskela/discsim/stargazers","contributors_url":"https://api.github.com/repos/JereKoskela/discsim/contributors","subscribers_url":"https://api.github.com/repos/JereKoskela/discsim/subscribers","subscription_url":"https://api.github.com/repos/JereKoskela/discsim/subscription","commits_url":"https://api.github.com/repos/JereKoskela/discsim/commits{/sha}","git_commits_url":"https://api.github.com/repos/JereKoskela/discsim/git/commits{/sha}","comments_url":"https://api.github.com/repos/JereKoskela/discsim/comments{/number}","issue_comment_url":"https://api.github.com/repos/JereKoskela/discsim/issues/comments{/number}","contents_url":"https://api.github.com/repos/JereKoskela/discsim/contents/{+path}","compare_url":"https://api.github.com/repos/JereKoskela/discsim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JereKoskela/discsim/merges","archive_url":"https://api.github.com/repos/JereKoskela/discsim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JereKoskela/discsim/downloads","issues_url":"https://api.github.com/repos/JereKoskela/discsim/issues{/number}","pulls_url":"https://api.github.com/repos/JereKoskela/discsim/pulls{/number}","milestones_url":"https://api.github.com/repos/JereKoskela/discsim/milestones{/number}","notifications_url":"https://api.github.com/repos/JereKoskela/discsim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JereKoskela/discsim/labels{/name}","releases_url":"https://api.github.com/repos/JereKoskela/discsim/releases{/id}","created_at":"2015-06-24T15:30:47Z","updated_at":"2015-06-24T15:30:47Z","pushed_at":"2015-07-23T19:24:27Z","git_url":"git://github.com/JereKoskela/discsim.git","ssh_url":"git@github.com:JereKoskela/discsim.git","clone_url":"https://github.com/JereKoskela/discsim.git","svn_url":"https://github.com/JereKoskela/discsim","homepage":null,"size":331,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jeromekelleher:master","ref":"master","sha":"d0c54d3bb2eba6d12df182f1eecbd4ba38453988","user":{"login":"jeromekelleher","id":2664569,"avatar_url":"https://avatars.githubusercontent.com/u/2664569?v=3","gravatar_id":"","url":"https://api.github.com/users/jeromekelleher","html_url":"https://github.com/jeromekelleher","followers_url":"https://api.github.com/users/jeromekelleher/followers","following_url":"https://api.github.com/users/jeromekelleher/following{/other_user}","gists_url":"https://api.github.com/users/jeromekelleher/gists{/gist_id}","starred_url":"https://api.github.com/users/jeromekelleher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeromekelleher/subscriptions","organizations_url":"https://api.github.com/users/jeromekelleher/orgs","repos_url":"https://api.github.com/users/jeromekelleher/repos","events_url":"https://api.github.com/users/jeromekelleher/events{/privacy}","received_events_url":"https://api.github.com/users/jeromekelleher/received_events","type":"User","site_admin":false},"repo":{"id":11788754,"name":"discsim","full_name":"jeromekelleher/discsim","owner":{"login":"jeromekelleher","id":2664569,"avatar_url":"https://avatars.githubusercontent.com/u/2664569?v=3","gravatar_id":"","url":"https://api.github.com/users/jeromekelleher","html_url":"https://github.com/jeromekelleher","followers_url":"https://api.github.com/users/jeromekelleher/followers","following_url":"https://api.github.com/users/jeromekelleher/following{/other_user}","gists_url":"https://api.github.com/users/jeromekelleher/gists{/gist_id}","starred_url":"https://api.github.com/users/jeromekelleher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeromekelleher/subscriptions","organizations_url":"https://api.github.com/users/jeromekelleher/orgs","repos_url":"https://api.github.com/users/jeromekelleher/repos","events_url":"https://api.github.com/users/jeromekelleher/events{/privacy}","received_events_url":"https://api.github.com/users/jeromekelleher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeromekelleher/discsim","description":"Efficient coalescent simulations in a spatial continuum","fork":false,"url":"https://api.github.com/repos/jeromekelleher/discsim","forks_url":"https://api.github.com/repos/jeromekelleher/discsim/forks","keys_url":"https://api.github.com/repos/jeromekelleher/discsim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeromekelleher/discsim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeromekelleher/discsim/teams","hooks_url":"https://api.github.com/repos/jeromekelleher/discsim/hooks","issue_events_url":"https://api.github.com/repos/jeromekelleher/discsim/issues/events{/number}","events_url":"https://api.github.com/repos/jeromekelleher/discsim/events","assignees_url":"https://api.github.com/repos/jeromekelleher/discsim/assignees{/user}","branches_url":"https://api.github.com/repos/jeromekelleher/discsim/branches{/branch}","tags_url":"https://api.github.com/repos/jeromekelleher/discsim/tags","blobs_url":"https://api.github.com/repos/jeromekelleher/discsim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeromekelleher/discsim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeromekelleher/discsim/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeromekelleher/discsim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeromekelleher/discsim/statuses/{sha}","languages_url":"https://api.github.com/repos/jeromekelleher/discsim/languages","stargazers_url":"https://api.github.com/repos/jeromekelleher/discsim/stargazers","contributors_url":"https://api.github.com/repos/jeromekelleher/discsim/contributors","subscribers_url":"https://api.github.com/repos/jeromekelleher/discsim/subscribers","subscription_url":"https://api.github.com/repos/jeromekelleher/discsim/subscription","commits_url":"https://api.github.com/repos/jeromekelleher/discsim/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeromekelleher/discsim/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeromekelleher/discsim/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeromekelleher/discsim/issues/comments{/number}","contents_url":"https://api.github.com/repos/jeromekelleher/discsim/contents/{+path}","compare_url":"https://api.github.com/repos/jeromekelleher/discsim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeromekelleher/discsim/merges","archive_url":"https://api.github.com/repos/jeromekelleher/discsim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeromekelleher/discsim/downloads","issues_url":"https://api.github.com/repos/jeromekelleher/discsim/issues{/number}","pulls_url":"https://api.github.com/repos/jeromekelleher/discsim/pulls{/number}","milestones_url":"https://api.github.com/repos/jeromekelleher/discsim/milestones{/number}","notifications_url":"https://api.github.com/repos/jeromekelleher/discsim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeromekelleher/discsim/labels{/name}","releases_url":"https://api.github.com/repos/jeromekelleher/discsim/releases{/id}","created_at":"2013-07-31T10:47:42Z","updated_at":"2015-01-02T09:25:12Z","pushed_at":"2015-07-24T08:22:35Z","git_url":"git://github.com/jeromekelleher/discsim.git","ssh_url":"git@github.com:jeromekelleher/discsim.git","clone_url":"https://github.com/jeromekelleher/discsim.git","svn_url":"https://github.com/jeromekelleher/discsim","homepage":null,"size":372,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jeromekelleher/discsim/pulls/1"},"html":{"href":"https://github.com/jeromekelleher/discsim/pull/1"},"issue":{"href":"https://api.github.com/repos/jeromekelleher/discsim/issues/1"},"comments":{"href":"https://api.github.com/repos/jeromekelleher/discsim/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/jeromekelleher/discsim/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/jeromekelleher/discsim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jeromekelleher/discsim/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/jeromekelleher/discsim/statuses/fdc2695128546216769f0366cfa7310588f98572"}}}}