{"action":"created","comment":{"url":"https://api.github.com/repos/freeorion/freeorion/pulls/comments/154520880","pull_request_review_id":80698427,"id":154520880,"diff_hunk":"@@ -1402,10 +1402,37 @@ def generate_production_orders():\n                 if (not prioritized) and (this_priority == PriorityType.PRODUCTION_INVASION):\n                     fo.issueRequeueProductionOrder(production_queue.size - 1, 0)  # move to front\n         print\n+    update_stockpile_use()\n     fo.updateProductionQueue()\n     _print_production_queue(after_turn=True)\n \n \n+def update_stockpile_use():\n+    \"\"\"Decide which elements in the production_queue will be enabled for drawing from the imperial stockpile.  This\n+    initial version simply ensures that every resource group with at least one item on the queue has its highest\n+    priority item be stockpile-enabled.\n+\n+    :return: None\n+    \"\"\"\n+    # TODO: Do a priority and risk evaluation to decide on enabling stockpile draws\n+    empire = fo.getEmpire()\n+    production_queue = empire.productionQueue\n+    resource_groups = set(tuple(el.key()) for el in empire.planetsWithAvailablePP)\n+    planets_with_group_stockpile_elem = set()\n+    for queue_index in range(len(production_queue)):\n+        element = production_queue[queue_index]\n+        if element.locationID in planets_with_group_stockpile_elem:\n+            continue","path":"default/python/AI/ProductionAI.py","position":24,"original_position":24,"commit_id":"a2a069a4e9786ff45c7856328a2fda41c8da0a05","original_commit_id":"a2a069a4e9786ff45c7856328a2fda41c8da0a05","user":{"login":"Dilvish-fo","id":10995939,"avatar_url":"https://avatars2.githubusercontent.com/u/10995939?v=4","gravatar_id":"","url":"https://api.github.com/users/Dilvish-fo","html_url":"https://github.com/Dilvish-fo","followers_url":"https://api.github.com/users/Dilvish-fo/followers","following_url":"https://api.github.com/users/Dilvish-fo/following{/other_user}","gists_url":"https://api.github.com/users/Dilvish-fo/gists{/gist_id}","starred_url":"https://api.github.com/users/Dilvish-fo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dilvish-fo/subscriptions","organizations_url":"https://api.github.com/users/Dilvish-fo/orgs","repos_url":"https://api.github.com/users/Dilvish-fo/repos","events_url":"https://api.github.com/users/Dilvish-fo/events{/privacy}","received_events_url":"https://api.github.com/users/Dilvish-fo/received_events","type":"User","site_admin":false},"body":"Seems to me that a more accurate (at least for the current code) version of that comment is already only a few (ok, 22) lines higher up, in the routine's docstring, where it seems more important.  A repeat isn't seeming warranted to me.","created_at":"2017-12-03T11:14:38Z","updated_at":"2017-12-03T11:14:38Z","html_url":"https://github.com/freeorion/freeorion/pull/1883#discussion_r154520880","pull_request_url":"https://api.github.com/repos/freeorion/freeorion/pulls/1883","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/freeorion/freeorion/pulls/comments/154520880"},"html":{"href":"https://github.com/freeorion/freeorion/pull/1883#discussion_r154520880"},"pull_request":{"href":"https://api.github.com/repos/freeorion/freeorion/pulls/1883"}},"in_reply_to_id":153295975},"pull_request":{"url":"https://api.github.com/repos/freeorion/freeorion/pulls/1883","id":154758245,"html_url":"https://github.com/freeorion/freeorion/pull/1883","diff_url":"https://github.com/freeorion/freeorion/pull/1883.diff","patch_url":"https://github.com/freeorion/freeorion/pull/1883.patch","issue_url":"https://api.github.com/repos/freeorion/freeorion/issues/1883","number":1883,"state":"open","locked":false,"title":"AI basic stockpile use","user":{"login":"Dilvish-fo","id":10995939,"avatar_url":"https://avatars2.githubusercontent.com/u/10995939?v=4","gravatar_id":"","url":"https://api.github.com/users/Dilvish-fo","html_url":"https://github.com/Dilvish-fo","followers_url":"https://api.github.com/users/Dilvish-fo/followers","following_url":"https://api.github.com/users/Dilvish-fo/following{/other_user}","gists_url":"https://api.github.com/users/Dilvish-fo/gists{/gist_id}","starred_url":"https://api.github.com/users/Dilvish-fo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dilvish-fo/subscriptions","organizations_url":"https://api.github.com/users/Dilvish-fo/orgs","repos_url":"https://api.github.com/users/Dilvish-fo/repos","events_url":"https://api.github.com/users/Dilvish-fo/events{/privacy}","received_events_url":"https://api.github.com/users/Dilvish-fo/received_events","type":"User","site_admin":false},"body":"Enables the AI to make basic use of the imperial stockpile.\r\n\r\nResolves #1879 ","created_at":"2017-11-27T09:20:10Z","updated_at":"2017-12-03T11:14:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc457f89a4c0cd2f96dfb3eca8007bf24e481b31","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Cjkjvfnby","id":171597,"avatar_url":"https://avatars1.githubusercontent.com/u/171597?v=4","gravatar_id":"","url":"https://api.github.com/users/Cjkjvfnby","html_url":"https://github.com/Cjkjvfnby","followers_url":"https://api.github.com/users/Cjkjvfnby/followers","following_url":"https://api.github.com/users/Cjkjvfnby/following{/other_user}","gists_url":"https://api.github.com/users/Cjkjvfnby/gists{/gist_id}","starred_url":"https://api.github.com/users/Cjkjvfnby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cjkjvfnby/subscriptions","organizations_url":"https://api.github.com/users/Cjkjvfnby/orgs","repos_url":"https://api.github.com/users/Cjkjvfnby/repos","events_url":"https://api.github.com/users/Cjkjvfnby/events{/privacy}","received_events_url":"https://api.github.com/users/Cjkjvfnby/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/freeorion/freeorion/milestones/18","html_url":"https://github.com/freeorion/freeorion/milestone/18","labels_url":"https://api.github.com/repos/freeorion/freeorion/milestones/18/labels","id":2316533,"number":18,"title":"v0.4.8 (mandatory)","description":"Bugs, features and pull requests that *must* be fixed/finalized for the 0.4.8 release. All issues and PRs assigned to this milestone are considered release-blocking.","creator":{"login":"Vezzra","id":10279417,"avatar_url":"https://avatars2.githubusercontent.com/u/10279417?v=4","gravatar_id":"","url":"https://api.github.com/users/Vezzra","html_url":"https://github.com/Vezzra","followers_url":"https://api.github.com/users/Vezzra/followers","following_url":"https://api.github.com/users/Vezzra/following{/other_user}","gists_url":"https://api.github.com/users/Vezzra/gists{/gist_id}","starred_url":"https://api.github.com/users/Vezzra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vezzra/subscriptions","organizations_url":"https://api.github.com/users/Vezzra/orgs","repos_url":"https://api.github.com/users/Vezzra/repos","events_url":"https://api.github.com/users/Vezzra/events{/privacy}","received_events_url":"https://api.github.com/users/Vezzra/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":262,"state":"open","created_at":"2017-02-12T13:01:43Z","updated_at":"2017-12-02T19:04:07Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/freeorion/freeorion/pulls/1883/commits","review_comments_url":"https://api.github.com/repos/freeorion/freeorion/pulls/1883/comments","review_comment_url":"https://api.github.com/repos/freeorion/freeorion/pulls/comments{/number}","comments_url":"https://api.github.com/repos/freeorion/freeorion/issues/1883/comments","statuses_url":"https://api.github.com/repos/freeorion/freeorion/statuses/a2a069a4e9786ff45c7856328a2fda41c8da0a05","head":{"label":"Dilvish-fo:ai_basic_stockpile","ref":"ai_basic_stockpile","sha":"a2a069a4e9786ff45c7856328a2fda41c8da0a05","user":{"login":"Dilvish-fo","id":10995939,"avatar_url":"https://avatars2.githubusercontent.com/u/10995939?v=4","gravatar_id":"","url":"https://api.github.com/users/Dilvish-fo","html_url":"https://github.com/Dilvish-fo","followers_url":"https://api.github.com/users/Dilvish-fo/followers","following_url":"https://api.github.com/users/Dilvish-fo/following{/other_user}","gists_url":"https://api.github.com/users/Dilvish-fo/gists{/gist_id}","starred_url":"https://api.github.com/users/Dilvish-fo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dilvish-fo/subscriptions","organizations_url":"https://api.github.com/users/Dilvish-fo/orgs","repos_url":"https://api.github.com/users/Dilvish-fo/repos","events_url":"https://api.github.com/users/Dilvish-fo/events{/privacy}","received_events_url":"https://api.github.com/users/Dilvish-fo/received_events","type":"User","site_admin":false},"repo":{"id":33093847,"name":"freeorion","full_name":"Dilvish-fo/freeorion","owner":{"login":"Dilvish-fo","id":10995939,"avatar_url":"https://avatars2.githubusercontent.com/u/10995939?v=4","gravatar_id":"","url":"https://api.github.com/users/Dilvish-fo","html_url":"https://github.com/Dilvish-fo","followers_url":"https://api.github.com/users/Dilvish-fo/followers","following_url":"https://api.github.com/users/Dilvish-fo/following{/other_user}","gists_url":"https://api.github.com/users/Dilvish-fo/gists{/gist_id}","starred_url":"https://api.github.com/users/Dilvish-fo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dilvish-fo/subscriptions","organizations_url":"https://api.github.com/users/Dilvish-fo/orgs","repos_url":"https://api.github.com/users/Dilvish-fo/repos","events_url":"https://api.github.com/users/Dilvish-fo/events{/privacy}","received_events_url":"https://api.github.com/users/Dilvish-fo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Dilvish-fo/freeorion","description":"Source code repository of the FreeOrion project.","fork":true,"url":"https://api.github.com/repos/Dilvish-fo/freeorion","forks_url":"https://api.github.com/repos/Dilvish-fo/freeorion/forks","keys_url":"https://api.github.com/repos/Dilvish-fo/freeorion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Dilvish-fo/freeorion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Dilvish-fo/freeorion/teams","hooks_url":"https://api.github.com/repos/Dilvish-fo/freeorion/hooks","issue_events_url":"https://api.github.com/repos/Dilvish-fo/freeorion/issues/events{/number}","events_url":"https://api.github.com/repos/Dilvish-fo/freeorion/events","assignees_url":"https://api.github.com/repos/Dilvish-fo/freeorion/assignees{/user}","branches_url":"https://api.github.com/repos/Dilvish-fo/freeorion/branches{/branch}","tags_url":"https://api.github.com/repos/Dilvish-fo/freeorion/tags","blobs_url":"https://api.github.com/repos/Dilvish-fo/freeorion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Dilvish-fo/freeorion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Dilvish-fo/freeorion/git/refs{/sha}","trees_url":"https://api.github.com/repos/Dilvish-fo/freeorion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Dilvish-fo/freeorion/statuses/{sha}","languages_url":"https://api.github.com/repos/Dilvish-fo/freeorion/languages","stargazers_url":"https://api.github.com/repos/Dilvish-fo/freeorion/stargazers","contributors_url":"https://api.github.com/repos/Dilvish-fo/freeorion/contributors","subscribers_url":"https://api.github.com/repos/Dilvish-fo/freeorion/subscribers","subscription_url":"https://api.github.com/repos/Dilvish-fo/freeorion/subscription","commits_url":"https://api.github.com/repos/Dilvish-fo/freeorion/commits{/sha}","git_commits_url":"https://api.github.com/repos/Dilvish-fo/freeorion/git/commits{/sha}","comments_url":"https://api.github.com/repos/Dilvish-fo/freeorion/comments{/number}","issue_comment_url":"https://api.github.com/repos/Dilvish-fo/freeorion/issues/comments{/number}","contents_url":"https://api.github.com/repos/Dilvish-fo/freeorion/contents/{+path}","compare_url":"https://api.github.com/repos/Dilvish-fo/freeorion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Dilvish-fo/freeorion/merges","archive_url":"https://api.github.com/repos/Dilvish-fo/freeorion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Dilvish-fo/freeorion/downloads","issues_url":"https://api.github.com/repos/Dilvish-fo/freeorion/issues{/number}","pulls_url":"https://api.github.com/repos/Dilvish-fo/freeorion/pulls{/number}","milestones_url":"https://api.github.com/repos/Dilvish-fo/freeorion/milestones{/number}","notifications_url":"https://api.github.com/repos/Dilvish-fo/freeorion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Dilvish-fo/freeorion/labels{/name}","releases_url":"https://api.github.com/repos/Dilvish-fo/freeorion/releases{/id}","deployments_url":"https://api.github.com/repos/Dilvish-fo/freeorion/deployments","created_at":"2015-03-29T23:31:21Z","updated_at":"2016-12-21T21:03:38Z","pushed_at":"2017-11-27T09:17:18Z","git_url":"git://github.com/Dilvish-fo/freeorion.git","ssh_url":"git@github.com:Dilvish-fo/freeorion.git","clone_url":"https://github.com/Dilvish-fo/freeorion.git","svn_url":"https://github.com/Dilvish-fo/freeorion","homepage":"http://www.freeorion.org/","size":542035,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"freeorion:master","ref":"master","sha":"cbf1e48ae5c744a6e2a140c3cb86b2d76807d555","user":{"login":"freeorion","id":1025550,"avatar_url":"https://avatars1.githubusercontent.com/u/1025550?v=4","gravatar_id":"","url":"https://api.github.com/users/freeorion","html_url":"https://github.com/freeorion","followers_url":"https://api.github.com/users/freeorion/followers","following_url":"https://api.github.com/users/freeorion/following{/other_user}","gists_url":"https://api.github.com/users/freeorion/gists{/gist_id}","starred_url":"https://api.github.com/users/freeorion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freeorion/subscriptions","organizations_url":"https://api.github.com/users/freeorion/orgs","repos_url":"https://api.github.com/users/freeorion/repos","events_url":"https://api.github.com/users/freeorion/events{/privacy}","received_events_url":"https://api.github.com/users/freeorion/received_events","type":"Organization","site_admin":false},"repo":{"id":33066062,"name":"freeorion","full_name":"freeorion/freeorion","owner":{"login":"freeorion","id":1025550,"avatar_url":"https://avatars1.githubusercontent.com/u/1025550?v=4","gravatar_id":"","url":"https://api.github.com/users/freeorion","html_url":"https://github.com/freeorion","followers_url":"https://api.github.com/users/freeorion/followers","following_url":"https://api.github.com/users/freeorion/following{/other_user}","gists_url":"https://api.github.com/users/freeorion/gists{/gist_id}","starred_url":"https://api.github.com/users/freeorion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freeorion/subscriptions","organizations_url":"https://api.github.com/users/freeorion/orgs","repos_url":"https://api.github.com/users/freeorion/repos","events_url":"https://api.github.com/users/freeorion/events{/privacy}","received_events_url":"https://api.github.com/users/freeorion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/freeorion/freeorion","description":"Source code repository of the FreeOrion project.","fork":false,"url":"https://api.github.com/repos/freeorion/freeorion","forks_url":"https://api.github.com/repos/freeorion/freeorion/forks","keys_url":"https://api.github.com/repos/freeorion/freeorion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/freeorion/freeorion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/freeorion/freeorion/teams","hooks_url":"https://api.github.com/repos/freeorion/freeorion/hooks","issue_events_url":"https://api.github.com/repos/freeorion/freeorion/issues/events{/number}","events_url":"https://api.github.com/repos/freeorion/freeorion/events","assignees_url":"https://api.github.com/repos/freeorion/freeorion/assignees{/user}","branches_url":"https://api.github.com/repos/freeorion/freeorion/branches{/branch}","tags_url":"https://api.github.com/repos/freeorion/freeorion/tags","blobs_url":"https://api.github.com/repos/freeorion/freeorion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/freeorion/freeorion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/freeorion/freeorion/git/refs{/sha}","trees_url":"https://api.github.com/repos/freeorion/freeorion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/freeorion/freeorion/statuses/{sha}","languages_url":"https://api.github.com/repos/freeorion/freeorion/languages","stargazers_url":"https://api.github.com/repos/freeorion/freeorion/stargazers","contributors_url":"https://api.github.com/repos/freeorion/freeorion/contributors","subscribers_url":"https://api.github.com/repos/freeorion/freeorion/subscribers","subscription_url":"https://api.github.com/repos/freeorion/freeorion/subscription","commits_url":"https://api.github.com/repos/freeorion/freeorion/commits{/sha}","git_commits_url":"https://api.github.com/repos/freeorion/freeorion/git/commits{/sha}","comments_url":"https://api.github.com/repos/freeorion/freeorion/comments{/number}","issue_comment_url":"https://api.github.com/repos/freeorion/freeorion/issues/comments{/number}","contents_url":"https://api.github.com/repos/freeorion/freeorion/contents/{+path}","compare_url":"https://api.github.com/repos/freeorion/freeorion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/freeorion/freeorion/merges","archive_url":"https://api.github.com/repos/freeorion/freeorion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/freeorion/freeorion/downloads","issues_url":"https://api.github.com/repos/freeorion/freeorion/issues{/number}","pulls_url":"https://api.github.com/repos/freeorion/freeorion/pulls{/number}","milestones_url":"https://api.github.com/repos/freeorion/freeorion/milestones{/number}","notifications_url":"https://api.github.com/repos/freeorion/freeorion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/freeorion/freeorion/labels{/name}","releases_url":"https://api.github.com/repos/freeorion/freeorion/releases{/id}","deployments_url":"https://api.github.com/repos/freeorion/freeorion/deployments","created_at":"2015-03-29T08:22:20Z","updated_at":"2017-12-02T21:38:42Z","pushed_at":"2017-12-02T19:04:07Z","git_url":"git://github.com/freeorion/freeorion.git","ssh_url":"git@github.com:freeorion/freeorion.git","clone_url":"https://github.com/freeorion/freeorion.git","svn_url":"https://github.com/freeorion/freeorion","homepage":"http://www.freeorion.org/","size":542489,"stargazers_count":259,"watchers_count":259,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":91,"mirror_url":null,"archived":false,"open_issues_count":192,"license":null,"forks":91,"open_issues":192,"watchers":259,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/freeorion/freeorion/pulls/1883"},"html":{"href":"https://github.com/freeorion/freeorion/pull/1883"},"issue":{"href":"https://api.github.com/repos/freeorion/freeorion/issues/1883"},"comments":{"href":"https://api.github.com/repos/freeorion/freeorion/issues/1883/comments"},"review_comments":{"href":"https://api.github.com/repos/freeorion/freeorion/pulls/1883/comments"},"review_comment":{"href":"https://api.github.com/repos/freeorion/freeorion/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/freeorion/freeorion/pulls/1883/commits"},"statuses":{"href":"https://api.github.com/repos/freeorion/freeorion/statuses/a2a069a4e9786ff45c7856328a2fda41c8da0a05"}},"author_association":"OWNER"}}
{"actor":{"display_login":"Dilvish-fo"}}