{"action":"created","comment":{"url":"https://api.github.com/repos/billstark/tetris-agent/pulls/comments/175987137","pull_request_review_id":105608596,"id":175987137,"diff_hunk":"@@ -25,3 +26,204 @@ public static void main(String[] args) {\n \t}\r\n \t\r\n }\r\n+\r\n+class Heuristics {\r\n+\tprivate int lineCleared;\r\n+\t\r\n+\tprivate double weightOfLineCleared;\r\n+\t\r\n+\tprivate int numberOfHoles;\r\n+\t\r\n+\tprivate double weightOfNumberOfHoles;\r\n+\t\r\n+\tprivate int totalWeightOfHoles;\r\n+\t\r\n+\tprivate double weightOfTotalWeightOfHoles;\r\n+\t\r\n+\tprivate int sumOfAdjacentColumnHeightDifference;\r\n+\t\r\n+\tprivate double weightOfSumOfAdjacentColumnHeightDifference;\r\n+\t\r\n+\tprivate int landingHeight;\r\n+\t\r\n+\tprivate double weightOfLandingHeight;\r\n+\t\r\n+\tprivate int totalHeight;\r\n+\t\r\n+\tprivate double weightOfTotalHeight;\r\n+\t\r\n+\tprivate int rangeOfHeight;\r\n+\t\r\n+\tprivate double weightOfRangeOfHeight;\r\n+\t\r\n+\t\r\n+\tpublic Heuristics(State thisState, State nextState) {\r\n+\t\tthis.lineCleared = nextState.getRowsCleared();\r\n+\t\t\r\n+\t\tthis.numberOfHoles = 0;\r\n+\t\tthis.totalWeightOfHoles = 0;\r\n+\t\tfor(int column = 0; column < State.COLS; column++) {\r\n+\t\t\tfor(int row = nextState.getTop()[column]-1; row >= 0; row--) {\r\n+\t\t\t\tif(nextState.getField()[row][column] == 0){\r\n+\t\t\t\t\tthis.numberOfHoles++;\r\n+\t\t\t\t\tthis.totalWeightOfHoles += (20 - row);\r","path":"src/PlayerSkeleton.java","position":49,"original_position":49,"commit_id":"e94b28d4073c982df3ce507ca8513aa895044dc9","original_commit_id":"e94b28d4073c982df3ce507ca8513aa895044dc9","user":{"login":"billstark","id":16464626,"avatar_url":"https://avatars3.githubusercontent.com/u/16464626?v=4","gravatar_id":"","url":"https://api.github.com/users/billstark","html_url":"https://github.com/billstark","followers_url":"https://api.github.com/users/billstark/followers","following_url":"https://api.github.com/users/billstark/following{/other_user}","gists_url":"https://api.github.com/users/billstark/gists{/gist_id}","starred_url":"https://api.github.com/users/billstark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billstark/subscriptions","organizations_url":"https://api.github.com/users/billstark/orgs","repos_url":"https://api.github.com/users/billstark/repos","events_url":"https://api.github.com/users/billstark/events{/privacy}","received_events_url":"https://api.github.com/users/billstark/received_events","type":"User","site_admin":false},"body":"20 is a magic number, maybe we could use State.ROWS - 1?","created_at":"2018-03-21T05:26:51Z","updated_at":"2018-03-21T05:45:00Z","html_url":"https://github.com/billstark/tetris-agent/pull/1#discussion_r175987137","pull_request_url":"https://api.github.com/repos/billstark/tetris-agent/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/billstark/tetris-agent/pulls/comments/175987137"},"html":{"href":"https://github.com/billstark/tetris-agent/pull/1#discussion_r175987137"},"pull_request":{"href":"https://api.github.com/repos/billstark/tetris-agent/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/billstark/tetris-agent/pulls/1","id":176382729,"html_url":"https://github.com/billstark/tetris-agent/pull/1","diff_url":"https://github.com/billstark/tetris-agent/pull/1.diff","patch_url":"https://github.com/billstark/tetris-agent/pull/1.patch","issue_url":"https://api.github.com/repos/billstark/tetris-agent/issues/1","number":1,"state":"open","locked":false,"title":"Create Heuristic Class","user":{"login":"xjh666","id":21235600,"avatar_url":"https://avatars1.githubusercontent.com/u/21235600?v=4","gravatar_id":"","url":"https://api.github.com/users/xjh666","html_url":"https://github.com/xjh666","followers_url":"https://api.github.com/users/xjh666/followers","following_url":"https://api.github.com/users/xjh666/following{/other_user}","gists_url":"https://api.github.com/users/xjh666/gists{/gist_id}","starred_url":"https://api.github.com/users/xjh666/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xjh666/subscriptions","organizations_url":"https://api.github.com/users/xjh666/orgs","repos_url":"https://api.github.com/users/xjh666/repos","events_url":"https://api.github.com/users/xjh666/events{/privacy}","received_events_url":"https://api.github.com/users/xjh666/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-21T04:57:03Z","updated_at":"2018-03-21T05:45:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82855931a06caed50fd92471099a6ae16465151e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/billstark/tetris-agent/pulls/1/commits","review_comments_url":"https://api.github.com/repos/billstark/tetris-agent/pulls/1/comments","review_comment_url":"https://api.github.com/repos/billstark/tetris-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/billstark/tetris-agent/issues/1/comments","statuses_url":"https://api.github.com/repos/billstark/tetris-agent/statuses/e94b28d4073c982df3ce507ca8513aa895044dc9","head":{"label":"billstark:XJH","ref":"XJH","sha":"e94b28d4073c982df3ce507ca8513aa895044dc9","user":{"login":"billstark","id":16464626,"avatar_url":"https://avatars3.githubusercontent.com/u/16464626?v=4","gravatar_id":"","url":"https://api.github.com/users/billstark","html_url":"https://github.com/billstark","followers_url":"https://api.github.com/users/billstark/followers","following_url":"https://api.github.com/users/billstark/following{/other_user}","gists_url":"https://api.github.com/users/billstark/gists{/gist_id}","starred_url":"https://api.github.com/users/billstark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billstark/subscriptions","organizations_url":"https://api.github.com/users/billstark/orgs","repos_url":"https://api.github.com/users/billstark/repos","events_url":"https://api.github.com/users/billstark/events{/privacy}","received_events_url":"https://api.github.com/users/billstark/received_events","type":"User","site_admin":false},"repo":{"id":125357783,"name":"tetris-agent","full_name":"billstark/tetris-agent","owner":{"login":"billstark","id":16464626,"avatar_url":"https://avatars3.githubusercontent.com/u/16464626?v=4","gravatar_id":"","url":"https://api.github.com/users/billstark","html_url":"https://github.com/billstark","followers_url":"https://api.github.com/users/billstark/followers","following_url":"https://api.github.com/users/billstark/following{/other_user}","gists_url":"https://api.github.com/users/billstark/gists{/gist_id}","starred_url":"https://api.github.com/users/billstark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billstark/subscriptions","organizations_url":"https://api.github.com/users/billstark/orgs","repos_url":"https://api.github.com/users/billstark/repos","events_url":"https://api.github.com/users/billstark/events{/privacy}","received_events_url":"https://api.github.com/users/billstark/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/billstark/tetris-agent","description":"ai agent that plays tetris automatically ","fork":false,"url":"https://api.github.com/repos/billstark/tetris-agent","forks_url":"https://api.github.com/repos/billstark/tetris-agent/forks","keys_url":"https://api.github.com/repos/billstark/tetris-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/billstark/tetris-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/billstark/tetris-agent/teams","hooks_url":"https://api.github.com/repos/billstark/tetris-agent/hooks","issue_events_url":"https://api.github.com/repos/billstark/tetris-agent/issues/events{/number}","events_url":"https://api.github.com/repos/billstark/tetris-agent/events","assignees_url":"https://api.github.com/repos/billstark/tetris-agent/assignees{/user}","branches_url":"https://api.github.com/repos/billstark/tetris-agent/branches{/branch}","tags_url":"https://api.github.com/repos/billstark/tetris-agent/tags","blobs_url":"https://api.github.com/repos/billstark/tetris-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/billstark/tetris-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/billstark/tetris-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/billstark/tetris-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/billstark/tetris-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/billstark/tetris-agent/languages","stargazers_url":"https://api.github.com/repos/billstark/tetris-agent/stargazers","contributors_url":"https://api.github.com/repos/billstark/tetris-agent/contributors","subscribers_url":"https://api.github.com/repos/billstark/tetris-agent/subscribers","subscription_url":"https://api.github.com/repos/billstark/tetris-agent/subscription","commits_url":"https://api.github.com/repos/billstark/tetris-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/billstark/tetris-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/billstark/tetris-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/billstark/tetris-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/billstark/tetris-agent/contents/{+path}","compare_url":"https://api.github.com/repos/billstark/tetris-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/billstark/tetris-agent/merges","archive_url":"https://api.github.com/repos/billstark/tetris-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/billstark/tetris-agent/downloads","issues_url":"https://api.github.com/repos/billstark/tetris-agent/issues{/number}","pulls_url":"https://api.github.com/repos/billstark/tetris-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/billstark/tetris-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/billstark/tetris-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/billstark/tetris-agent/labels{/name}","releases_url":"https://api.github.com/repos/billstark/tetris-agent/releases{/id}","deployments_url":"https://api.github.com/repos/billstark/tetris-agent/deployments","created_at":"2018-03-15T11:32:52Z","updated_at":"2018-03-18T07:52:53Z","pushed_at":"2018-03-21T05:07:10Z","git_url":"git://github.com/billstark/tetris-agent.git","ssh_url":"git@github.com:billstark/tetris-agent.git","clone_url":"https://github.com/billstark/tetris-agent.git","svn_url":"https://github.com/billstark/tetris-agent","homepage":null,"size":12,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"billstark:PSO","ref":"PSO","sha":"21ff0364fd6521efd59930e23b0466bef3210f3b","user":{"login":"billstark","id":16464626,"avatar_url":"https://avatars3.githubusercontent.com/u/16464626?v=4","gravatar_id":"","url":"https://api.github.com/users/billstark","html_url":"https://github.com/billstark","followers_url":"https://api.github.com/users/billstark/followers","following_url":"https://api.github.com/users/billstark/following{/other_user}","gists_url":"https://api.github.com/users/billstark/gists{/gist_id}","starred_url":"https://api.github.com/users/billstark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billstark/subscriptions","organizations_url":"https://api.github.com/users/billstark/orgs","repos_url":"https://api.github.com/users/billstark/repos","events_url":"https://api.github.com/users/billstark/events{/privacy}","received_events_url":"https://api.github.com/users/billstark/received_events","type":"User","site_admin":false},"repo":{"id":125357783,"name":"tetris-agent","full_name":"billstark/tetris-agent","owner":{"login":"billstark","id":16464626,"avatar_url":"https://avatars3.githubusercontent.com/u/16464626?v=4","gravatar_id":"","url":"https://api.github.com/users/billstark","html_url":"https://github.com/billstark","followers_url":"https://api.github.com/users/billstark/followers","following_url":"https://api.github.com/users/billstark/following{/other_user}","gists_url":"https://api.github.com/users/billstark/gists{/gist_id}","starred_url":"https://api.github.com/users/billstark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billstark/subscriptions","organizations_url":"https://api.github.com/users/billstark/orgs","repos_url":"https://api.github.com/users/billstark/repos","events_url":"https://api.github.com/users/billstark/events{/privacy}","received_events_url":"https://api.github.com/users/billstark/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/billstark/tetris-agent","description":"ai agent that plays tetris automatically ","fork":false,"url":"https://api.github.com/repos/billstark/tetris-agent","forks_url":"https://api.github.com/repos/billstark/tetris-agent/forks","keys_url":"https://api.github.com/repos/billstark/tetris-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/billstark/tetris-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/billstark/tetris-agent/teams","hooks_url":"https://api.github.com/repos/billstark/tetris-agent/hooks","issue_events_url":"https://api.github.com/repos/billstark/tetris-agent/issues/events{/number}","events_url":"https://api.github.com/repos/billstark/tetris-agent/events","assignees_url":"https://api.github.com/repos/billstark/tetris-agent/assignees{/user}","branches_url":"https://api.github.com/repos/billstark/tetris-agent/branches{/branch}","tags_url":"https://api.github.com/repos/billstark/tetris-agent/tags","blobs_url":"https://api.github.com/repos/billstark/tetris-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/billstark/tetris-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/billstark/tetris-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/billstark/tetris-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/billstark/tetris-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/billstark/tetris-agent/languages","stargazers_url":"https://api.github.com/repos/billstark/tetris-agent/stargazers","contributors_url":"https://api.github.com/repos/billstark/tetris-agent/contributors","subscribers_url":"https://api.github.com/repos/billstark/tetris-agent/subscribers","subscription_url":"https://api.github.com/repos/billstark/tetris-agent/subscription","commits_url":"https://api.github.com/repos/billstark/tetris-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/billstark/tetris-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/billstark/tetris-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/billstark/tetris-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/billstark/tetris-agent/contents/{+path}","compare_url":"https://api.github.com/repos/billstark/tetris-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/billstark/tetris-agent/merges","archive_url":"https://api.github.com/repos/billstark/tetris-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/billstark/tetris-agent/downloads","issues_url":"https://api.github.com/repos/billstark/tetris-agent/issues{/number}","pulls_url":"https://api.github.com/repos/billstark/tetris-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/billstark/tetris-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/billstark/tetris-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/billstark/tetris-agent/labels{/name}","releases_url":"https://api.github.com/repos/billstark/tetris-agent/releases{/id}","deployments_url":"https://api.github.com/repos/billstark/tetris-agent/deployments","created_at":"2018-03-15T11:32:52Z","updated_at":"2018-03-18T07:52:53Z","pushed_at":"2018-03-21T05:07:10Z","git_url":"git://github.com/billstark/tetris-agent.git","ssh_url":"git@github.com:billstark/tetris-agent.git","clone_url":"https://github.com/billstark/tetris-agent.git","svn_url":"https://github.com/billstark/tetris-agent","homepage":null,"size":12,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/billstark/tetris-agent/pulls/1"},"html":{"href":"https://github.com/billstark/tetris-agent/pull/1"},"issue":{"href":"https://api.github.com/repos/billstark/tetris-agent/issues/1"},"comments":{"href":"https://api.github.com/repos/billstark/tetris-agent/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/billstark/tetris-agent/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/billstark/tetris-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/billstark/tetris-agent/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/billstark/tetris-agent/statuses/e94b28d4073c982df3ce507ca8513aa895044dc9"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"billstark"}}