{"action":"created","comment":{"url":"https://api.github.com/repos/vcmi/vcmi/pulls/comments/207724032","pull_request_review_id":143398702,"id":207724032,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzcyNDAzMg==","diff_hunk":"@@ -373,142 +373,93 @@ float FuzzyHelper::evaluate(Goals::RecruitHero & g)\n {\r\n \treturn 1;\r\n }\r\n-HeroMovementGoalEngine::~HeroMovementGoalEngine()\r\n-{\r\n-\tdelete strengthRatio;\r\n-\tdelete heroStrength;\r\n-\tdelete turnDistance;\r\n-\tdelete missionImportance;\r\n-\tdelete estimatedReward;\r\n-}\r\n-\r\n-void FuzzyHelper::initVisitTile()\r\n+HeroMovementGoalEngineBase::HeroMovementGoalEngineBase()\r\n {\r\n \ttry\r\n \t{\r\n-\t\tvt.strengthRatio = new fl::InputVariable(\"strengthRatio\"); //hero must be strong enough to defeat guards\r\n-\t\tvt.heroStrength = new fl::InputVariable(\"heroStrength\"); //we want to use weakest possible hero\r\n-\t\tvt.turnDistance = new fl::InputVariable(\"turnDistance\"); //we want to use hero who is near\r\n-\t\tvt.missionImportance = new fl::InputVariable(\"lockedMissionImportance\"); //we may want to preempt hero with low-priority mission\r\n-\t\tvt.estimatedReward = new fl::InputVariable(\"estimatedReward\"); //indicate AI that content of the file is important or it is probably bad\r\n-\t\tvt.value = new fl::OutputVariable(\"Value\");\r\n-\t\tvt.value->setMinimum(0);\r\n-\t\tvt.value->setMaximum(5);\r\n-\r\n-\t\tstd::vector<fl::InputVariable *> helper = {vt.strengthRatio, vt.heroStrength, vt.turnDistance, vt.missionImportance, vt.estimatedReward};\r\n+\t\tstrengthRatio = new fl::InputVariable(\"strengthRatio\"); //hero must be strong enough to defeat guards\r\n+\t\theroStrength = new fl::InputVariable(\"heroStrength\"); //we want to use weakest possible hero\r\n+\t\tturnDistance = new fl::InputVariable(\"turnDistance\"); //we want to use hero who is near\r\n+\t\tmissionImportance = new fl::InputVariable(\"lockedMissionImportance\"); //we may want to preempt hero with low-priority mission\r\n+\t\testimatedReward = new fl::InputVariable(\"estimatedReward\"); //indicate AI that content of the file is important or it is probably bad\r\n+\t\tvalue = new fl::OutputVariable(\"Value\");\r\n+\t\tvalue->setMinimum(0);\r\n+\t\tvalue->setMaximum(5);\r\n+\r\n+\t\tstd::vector<fl::InputVariable *> helper = { strengthRatio, heroStrength, turnDistance, missionImportance, estimatedReward };\r\n \t\tfor(auto val : helper)\r\n \t\t{\r\n-\t\t\tvt.engine.addInputVariable(val);\r\n+\t\t\tengine.addInputVariable(val);\r\n \t\t}\r\n-\t\tvt.engine.addOutputVariable(vt.value);\r\n+\t\tengine.addOutputVariable(value);\r\n \r\n-\t\tvt.strengthRatio->addTerm(new fl::Ramp(\"LOW\", SAFE_ATTACK_CONSTANT, 0));\r\n-\t\tvt.strengthRatio->addTerm(new fl::Ramp(\"HIGH\", SAFE_ATTACK_CONSTANT, SAFE_ATTACK_CONSTANT * 3));\r\n-\t\tvt.strengthRatio->setRange(0, SAFE_ATTACK_CONSTANT * 3);\r\n+\t\tstrengthRatio->addTerm(new fl::Ramp(\"LOW\", SAFE_ATTACK_CONSTANT, 0));\r\n+\t\tstrengthRatio->addTerm(new fl::Ramp(\"HIGH\", SAFE_ATTACK_CONSTANT, SAFE_ATTACK_CONSTANT * 3));\r\n+\t\tstrengthRatio->setRange(0, SAFE_ATTACK_CONSTANT * 3);\r\n \r\n \t\t//strength compared to our main hero\r\n-\t\tvt.heroStrength->addTerm(new fl::Ramp(\"LOW\", 0.2, 0));\r\n-\t\tvt.heroStrength->addTerm(new fl::Triangle(\"MEDIUM\", 0.2, 0.8));\r\n-\t\tvt.heroStrength->addTerm(new fl::Ramp(\"HIGH\", 0.5, 1));\r\n-\t\tvt.heroStrength->setRange(0.0, 1.0);\r\n+\t\theroStrength->addTerm(new fl::Ramp(\"LOW\", 0.2, 0));\r\n+\t\theroStrength->addTerm(new fl::Triangle(\"MEDIUM\", 0.2, 0.8));\r","path":"AI/VCAI/Fuzzy.cpp","position":90,"original_position":77,"commit_id":"a940892e704cb39eb9610f672a1b21fb57123812","original_commit_id":"a940892e704cb39eb9610f672a1b21fb57123812","user":{"login":"alexvins","id":1083924,"node_id":"MDQ6VXNlcjEwODM5MjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1083924?v=4","gravatar_id":"","url":"https://api.github.com/users/alexvins","html_url":"https://github.com/alexvins","followers_url":"https://api.github.com/users/alexvins/followers","following_url":"https://api.github.com/users/alexvins/following{/other_user}","gists_url":"https://api.github.com/users/alexvins/gists{/gist_id}","starred_url":"https://api.github.com/users/alexvins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexvins/subscriptions","organizations_url":"https://api.github.com/users/alexvins/orgs","repos_url":"https://api.github.com/users/alexvins/repos","events_url":"https://api.github.com/users/alexvins/events{/privacy}","received_events_url":"https://api.github.com/users/alexvins/received_events","type":"User","site_admin":false},"body":"If input is exactly 0.2, no term will be actually active","created_at":"2018-08-05T03:05:51Z","updated_at":"2018-08-05T03:05:51Z","html_url":"https://github.com/vcmi/vcmi/pull/474#discussion_r207724032","pull_request_url":"https://api.github.com/repos/vcmi/vcmi/pulls/474","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/vcmi/vcmi/pulls/comments/207724032"},"html":{"href":"https://github.com/vcmi/vcmi/pull/474#discussion_r207724032"},"pull_request":{"href":"https://api.github.com/repos/vcmi/vcmi/pulls/474"}}},"pull_request":{"url":"https://api.github.com/repos/vcmi/vcmi/pulls/474","id":206197492,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2MTk3NDky","html_url":"https://github.com/vcmi/vcmi/pull/474","diff_url":"https://github.com/vcmi/vcmi/pull/474.diff","patch_url":"https://github.com/vcmi/vcmi/pull/474.patch","issue_url":"https://api.github.com/repos/vcmi/vcmi/issues/474","number":474,"state":"open","locked":false,"title":"[WIP] FuzzyHelper refactoring + Ai Map Object Evaluation improvements","user":{"login":"dydzio0614","id":9436577,"node_id":"MDQ6VXNlcjk0MzY1Nzc=","avatar_url":"https://avatars1.githubusercontent.com/u/9436577?v=4","gravatar_id":"","url":"https://api.github.com/users/dydzio0614","html_url":"https://github.com/dydzio0614","followers_url":"https://api.github.com/users/dydzio0614/followers","following_url":"https://api.github.com/users/dydzio0614/following{/other_user}","gists_url":"https://api.github.com/users/dydzio0614/gists{/gist_id}","starred_url":"https://api.github.com/users/dydzio0614/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dydzio0614/subscriptions","organizations_url":"https://api.github.com/users/dydzio0614/orgs","repos_url":"https://api.github.com/users/dydzio0614/repos","events_url":"https://api.github.com/users/dydzio0614/events{/privacy}","received_events_url":"https://api.github.com/users/dydzio0614/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-04T15:38:44Z","updated_at":"2018-08-05T03:05:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0bf5dcf9a1aec4eea9346d96daae25f999ad2b99","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vcmi/vcmi/pulls/474/commits","review_comments_url":"https://api.github.com/repos/vcmi/vcmi/pulls/474/comments","review_comment_url":"https://api.github.com/repos/vcmi/vcmi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vcmi/vcmi/issues/474/comments","statuses_url":"https://api.github.com/repos/vcmi/vcmi/statuses/a940892e704cb39eb9610f672a1b21fb57123812","head":{"label":"vcmi:FuzzyHelperRework","ref":"FuzzyHelperRework","sha":"a940892e704cb39eb9610f672a1b21fb57123812","user":{"login":"vcmi","id":2861395,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NjEzOTU=","avatar_url":"https://avatars3.githubusercontent.com/u/2861395?v=4","gravatar_id":"","url":"https://api.github.com/users/vcmi","html_url":"https://github.com/vcmi","followers_url":"https://api.github.com/users/vcmi/followers","following_url":"https://api.github.com/users/vcmi/following{/other_user}","gists_url":"https://api.github.com/users/vcmi/gists{/gist_id}","starred_url":"https://api.github.com/users/vcmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcmi/subscriptions","organizations_url":"https://api.github.com/users/vcmi/orgs","repos_url":"https://api.github.com/users/vcmi/repos","events_url":"https://api.github.com/users/vcmi/events{/privacy}","received_events_url":"https://api.github.com/users/vcmi/received_events","type":"Organization","site_admin":false},"repo":{"id":18490421,"node_id":"MDEwOlJlcG9zaXRvcnkxODQ5MDQyMQ==","name":"vcmi","full_name":"vcmi/vcmi","owner":{"login":"vcmi","id":2861395,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NjEzOTU=","avatar_url":"https://avatars3.githubusercontent.com/u/2861395?v=4","gravatar_id":"","url":"https://api.github.com/users/vcmi","html_url":"https://github.com/vcmi","followers_url":"https://api.github.com/users/vcmi/followers","following_url":"https://api.github.com/users/vcmi/following{/other_user}","gists_url":"https://api.github.com/users/vcmi/gists{/gist_id}","starred_url":"https://api.github.com/users/vcmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcmi/subscriptions","organizations_url":"https://api.github.com/users/vcmi/orgs","repos_url":"https://api.github.com/users/vcmi/repos","events_url":"https://api.github.com/users/vcmi/events{/privacy}","received_events_url":"https://api.github.com/users/vcmi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vcmi/vcmi","description":"Open-source engine for Heroes of Might and Magic III","fork":false,"url":"https://api.github.com/repos/vcmi/vcmi","forks_url":"https://api.github.com/repos/vcmi/vcmi/forks","keys_url":"https://api.github.com/repos/vcmi/vcmi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vcmi/vcmi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vcmi/vcmi/teams","hooks_url":"https://api.github.com/repos/vcmi/vcmi/hooks","issue_events_url":"https://api.github.com/repos/vcmi/vcmi/issues/events{/number}","events_url":"https://api.github.com/repos/vcmi/vcmi/events","assignees_url":"https://api.github.com/repos/vcmi/vcmi/assignees{/user}","branches_url":"https://api.github.com/repos/vcmi/vcmi/branches{/branch}","tags_url":"https://api.github.com/repos/vcmi/vcmi/tags","blobs_url":"https://api.github.com/repos/vcmi/vcmi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vcmi/vcmi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vcmi/vcmi/git/refs{/sha}","trees_url":"https://api.github.com/repos/vcmi/vcmi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vcmi/vcmi/statuses/{sha}","languages_url":"https://api.github.com/repos/vcmi/vcmi/languages","stargazers_url":"https://api.github.com/repos/vcmi/vcmi/stargazers","contributors_url":"https://api.github.com/repos/vcmi/vcmi/contributors","subscribers_url":"https://api.github.com/repos/vcmi/vcmi/subscribers","subscription_url":"https://api.github.com/repos/vcmi/vcmi/subscription","commits_url":"https://api.github.com/repos/vcmi/vcmi/commits{/sha}","git_commits_url":"https://api.github.com/repos/vcmi/vcmi/git/commits{/sha}","comments_url":"https://api.github.com/repos/vcmi/vcmi/comments{/number}","issue_comment_url":"https://api.github.com/repos/vcmi/vcmi/issues/comments{/number}","contents_url":"https://api.github.com/repos/vcmi/vcmi/contents/{+path}","compare_url":"https://api.github.com/repos/vcmi/vcmi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vcmi/vcmi/merges","archive_url":"https://api.github.com/repos/vcmi/vcmi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vcmi/vcmi/downloads","issues_url":"https://api.github.com/repos/vcmi/vcmi/issues{/number}","pulls_url":"https://api.github.com/repos/vcmi/vcmi/pulls{/number}","milestones_url":"https://api.github.com/repos/vcmi/vcmi/milestones{/number}","notifications_url":"https://api.github.com/repos/vcmi/vcmi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vcmi/vcmi/labels{/name}","releases_url":"https://api.github.com/repos/vcmi/vcmi/releases{/id}","deployments_url":"https://api.github.com/repos/vcmi/vcmi/deployments","created_at":"2014-04-06T13:42:23Z","updated_at":"2018-08-05T02:42:59Z","pushed_at":"2018-08-05T02:42:56Z","git_url":"git://github.com/vcmi/vcmi.git","ssh_url":"git@github.com:vcmi/vcmi.git","clone_url":"https://github.com/vcmi/vcmi.git","svn_url":"https://github.com/vcmi/vcmi","homepage":"https://vcmi.eu/","size":36205,"stargazers_count":852,"watchers_count":852,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":162,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":162,"open_issues":18,"watchers":852,"default_branch":"develop"}},"base":{"label":"vcmi:develop","ref":"develop","sha":"cde2d73982d36a5daee7fdeff20d17134342c476","user":{"login":"vcmi","id":2861395,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NjEzOTU=","avatar_url":"https://avatars3.githubusercontent.com/u/2861395?v=4","gravatar_id":"","url":"https://api.github.com/users/vcmi","html_url":"https://github.com/vcmi","followers_url":"https://api.github.com/users/vcmi/followers","following_url":"https://api.github.com/users/vcmi/following{/other_user}","gists_url":"https://api.github.com/users/vcmi/gists{/gist_id}","starred_url":"https://api.github.com/users/vcmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcmi/subscriptions","organizations_url":"https://api.github.com/users/vcmi/orgs","repos_url":"https://api.github.com/users/vcmi/repos","events_url":"https://api.github.com/users/vcmi/events{/privacy}","received_events_url":"https://api.github.com/users/vcmi/received_events","type":"Organization","site_admin":false},"repo":{"id":18490421,"node_id":"MDEwOlJlcG9zaXRvcnkxODQ5MDQyMQ==","name":"vcmi","full_name":"vcmi/vcmi","owner":{"login":"vcmi","id":2861395,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NjEzOTU=","avatar_url":"https://avatars3.githubusercontent.com/u/2861395?v=4","gravatar_id":"","url":"https://api.github.com/users/vcmi","html_url":"https://github.com/vcmi","followers_url":"https://api.github.com/users/vcmi/followers","following_url":"https://api.github.com/users/vcmi/following{/other_user}","gists_url":"https://api.github.com/users/vcmi/gists{/gist_id}","starred_url":"https://api.github.com/users/vcmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcmi/subscriptions","organizations_url":"https://api.github.com/users/vcmi/orgs","repos_url":"https://api.github.com/users/vcmi/repos","events_url":"https://api.github.com/users/vcmi/events{/privacy}","received_events_url":"https://api.github.com/users/vcmi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vcmi/vcmi","description":"Open-source engine for Heroes of Might and Magic III","fork":false,"url":"https://api.github.com/repos/vcmi/vcmi","forks_url":"https://api.github.com/repos/vcmi/vcmi/forks","keys_url":"https://api.github.com/repos/vcmi/vcmi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vcmi/vcmi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vcmi/vcmi/teams","hooks_url":"https://api.github.com/repos/vcmi/vcmi/hooks","issue_events_url":"https://api.github.com/repos/vcmi/vcmi/issues/events{/number}","events_url":"https://api.github.com/repos/vcmi/vcmi/events","assignees_url":"https://api.github.com/repos/vcmi/vcmi/assignees{/user}","branches_url":"https://api.github.com/repos/vcmi/vcmi/branches{/branch}","tags_url":"https://api.github.com/repos/vcmi/vcmi/tags","blobs_url":"https://api.github.com/repos/vcmi/vcmi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vcmi/vcmi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vcmi/vcmi/git/refs{/sha}","trees_url":"https://api.github.com/repos/vcmi/vcmi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vcmi/vcmi/statuses/{sha}","languages_url":"https://api.github.com/repos/vcmi/vcmi/languages","stargazers_url":"https://api.github.com/repos/vcmi/vcmi/stargazers","contributors_url":"https://api.github.com/repos/vcmi/vcmi/contributors","subscribers_url":"https://api.github.com/repos/vcmi/vcmi/subscribers","subscription_url":"https://api.github.com/repos/vcmi/vcmi/subscription","commits_url":"https://api.github.com/repos/vcmi/vcmi/commits{/sha}","git_commits_url":"https://api.github.com/repos/vcmi/vcmi/git/commits{/sha}","comments_url":"https://api.github.com/repos/vcmi/vcmi/comments{/number}","issue_comment_url":"https://api.github.com/repos/vcmi/vcmi/issues/comments{/number}","contents_url":"https://api.github.com/repos/vcmi/vcmi/contents/{+path}","compare_url":"https://api.github.com/repos/vcmi/vcmi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vcmi/vcmi/merges","archive_url":"https://api.github.com/repos/vcmi/vcmi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vcmi/vcmi/downloads","issues_url":"https://api.github.com/repos/vcmi/vcmi/issues{/number}","pulls_url":"https://api.github.com/repos/vcmi/vcmi/pulls{/number}","milestones_url":"https://api.github.com/repos/vcmi/vcmi/milestones{/number}","notifications_url":"https://api.github.com/repos/vcmi/vcmi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vcmi/vcmi/labels{/name}","releases_url":"https://api.github.com/repos/vcmi/vcmi/releases{/id}","deployments_url":"https://api.github.com/repos/vcmi/vcmi/deployments","created_at":"2014-04-06T13:42:23Z","updated_at":"2018-08-05T02:42:59Z","pushed_at":"2018-08-05T02:42:56Z","git_url":"git://github.com/vcmi/vcmi.git","ssh_url":"git@github.com:vcmi/vcmi.git","clone_url":"https://github.com/vcmi/vcmi.git","svn_url":"https://github.com/vcmi/vcmi","homepage":"https://vcmi.eu/","size":36205,"stargazers_count":852,"watchers_count":852,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":162,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":162,"open_issues":18,"watchers":852,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/vcmi/vcmi/pulls/474"},"html":{"href":"https://github.com/vcmi/vcmi/pull/474"},"issue":{"href":"https://api.github.com/repos/vcmi/vcmi/issues/474"},"comments":{"href":"https://api.github.com/repos/vcmi/vcmi/issues/474/comments"},"review_comments":{"href":"https://api.github.com/repos/vcmi/vcmi/pulls/474/comments"},"review_comment":{"href":"https://api.github.com/repos/vcmi/vcmi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vcmi/vcmi/pulls/474/commits"},"statuses":{"href":"https://api.github.com/repos/vcmi/vcmi/statuses/a940892e704cb39eb9610f672a1b21fb57123812"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"alexvins"}}