{"action":"created","issue":{"url":"https://api.github.com/repos/triplea-game/triplea/issues/908","repository_url":"https://api.github.com/repos/triplea-game/triplea","labels_url":"https://api.github.com/repos/triplea-game/triplea/issues/908/labels{/name}","comments_url":"https://api.github.com/repos/triplea-game/triplea/issues/908/comments","events_url":"https://api.github.com/repos/triplea-game/triplea/issues/908/events","html_url":"https://github.com/triplea-game/triplea/pull/908","id":163986159,"number":908,"title":"AI refactor territory value utils to improve performance","user":{"login":"ron-murhammer","id":1427689,"avatar_url":"https://avatars.githubusercontent.com/u/1427689?v=3","gravatar_id":"","url":"https://api.github.com/users/ron-murhammer","html_url":"https://github.com/ron-murhammer","followers_url":"https://api.github.com/users/ron-murhammer/followers","following_url":"https://api.github.com/users/ron-murhammer/following{/other_user}","gists_url":"https://api.github.com/users/ron-murhammer/gists{/gist_id}","starred_url":"https://api.github.com/users/ron-murhammer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ron-murhammer/subscriptions","organizations_url":"https://api.github.com/users/ron-murhammer/orgs","repos_url":"https://api.github.com/users/ron-murhammer/repos","events_url":"https://api.github.com/users/ron-murhammer/events{/privacy}","received_events_url":"https://api.github.com/users/ron-murhammer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-06T02:29:39Z","updated_at":"2016-07-07T07:40:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/triplea-game/triplea/pulls/908","html_url":"https://github.com/triplea-game/triplea/pull/908","diff_url":"https://github.com/triplea-game/triplea/pull/908.diff","patch_url":"https://github.com/triplea-game/triplea/pull/908.patch"},"body":"High level goal is to improve performance of Fast AI on large maps (this PR addresses CombatMove in particular).\r\n\r\nCurrently the AI always find 'territory value' for all territories on a map. This tends to be rather slow for larger maps such as WaW as it involves doing distance calculations for all territories even though each nation only really cares about territories that it can move to or is already on.\r\n\r\nThis PR improves performance mainly by allowing a list of territories to be passed in rather than having to find value for all territories. It also adds a check to find only the closest factories to avoid calculating distances for factories that are really far away from territories so add very little value. Lots of refactoring changes made as well to improve code readability and maintainability. Its probably not perfect but a step in the right direction.\r\n\r\nOverall, performance for combat move phase on WaW German turn 1 went from around 14-15s before to 7-8s after the change when using Fast AI. This should make even a more dramatic improvement for smaller AI nations as they have few that need calculated but would previously calculate value for the entire map.\r\n\r\n<!-- Reviewable:start -->\r\n---\r\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/triplea-game/triplea/908)\r\n<!-- Reviewable:end -->\r\n"},"comment":{"url":"https://api.github.com/repos/triplea-game/triplea/issues/comments/231005952","html_url":"https://github.com/triplea-game/triplea/pull/908#issuecomment-231005952","issue_url":"https://api.github.com/repos/triplea-game/triplea/issues/908","id":231005952,"user":{"login":"DanVanAtta","id":12397753,"avatar_url":"https://avatars.githubusercontent.com/u/12397753?v=3","gravatar_id":"","url":"https://api.github.com/users/DanVanAtta","html_url":"https://github.com/DanVanAtta","followers_url":"https://api.github.com/users/DanVanAtta/followers","following_url":"https://api.github.com/users/DanVanAtta/following{/other_user}","gists_url":"https://api.github.com/users/DanVanAtta/gists{/gist_id}","starred_url":"https://api.github.com/users/DanVanAtta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanVanAtta/subscriptions","organizations_url":"https://api.github.com/users/DanVanAtta/orgs","repos_url":"https://api.github.com/users/DanVanAtta/repos","events_url":"https://api.github.com/users/DanVanAtta/events{/privacy}","received_events_url":"https://api.github.com/users/DanVanAtta/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T07:40:43Z","updated_at":"2016-07-07T07:40:43Z","body":"Most of the refactoring looks good and straight forward. I'll take a deeper look at the functional changes tomorrow evening."}}
{"actor":{"display_login":"DanVanAtta"}}