{"action":"created","comment":{"url":"https://api.github.com/repos/aimacode/aima-java/pulls/comments/106167421","pull_request_review_id":27073573,"id":106167421,"diff_hunk":"@@ -22,68 +18,87 @@\n  * frontiers.\n  * @author manthan\n  */\n-public class BidirectionalSearch<A, S> implements SearchForActionsBidirectionallyFunction<A, S> {\n+public class BidirectionalSearch<A, S> implements SearchForActionsBidirectionallyFunction<A, S>, BidirectionalActions<A> {\n \n+    private List<A> fromInitialStatePartList = new ArrayList<>();\n+    private List<A> fromGoalStatePartList = new ArrayList<>();\n+    private List<A> fromInitialStateToGoalStateList = new ArrayList<>();\n+    private List<A> fromGoalStateToInitialStateList = new ArrayList<>();\n+    private BidirectionalActions<A> bidirectionalActions;\n+    private Node<A, S> previousMeetingOfTwoFrontiers;\n+    private Node<A, S> meetingOfTwoFrontiers;\n+    private Node<A, S> nextNodeToBeEvaluated;\n+    private boolean fromFront;\n     @Override\n-    public List<A> apply(Problem<A, S> originalProblem, Problem<A, S> reverseProblem) {\n+\n+    public BidirectionalActions<A> apply(Problem<A, S> originalProblem, Problem<A, S> reverseProblem) {\n         Node<A, S> node = newRootNode(originalProblem.initialState(), 0);\n         if (originalProblem.isGoalState(node.state())) {\n-            return solution(node);\n+            this.previousMeetingOfTwoFrontiers = node;\n+            this.nextNodeToBeEvaluated = null;\n+            return bidirectionalActions;\n         }\n         Node<A, S> revNode = newRootNode(reverseProblem.initialState(), 0);\n         Queue<Node<A, S>> front = newFIFOQueue(node);\n         Queue<Node<A, S>> back = newFIFOQueue(revNode);\n-        Set<S> exploredFront = newExploredSet();\n-        Set<S> exploredBack = newExploredSet();\n+        HashMap<S, Node<A, S>> exploredFront = newExploredMap();\n+        HashMap<S, Node<A, S>> exploredBack = newExploredMap();\n \n-        exploredFront.add(node.state());\n-        exploredBack.add(revNode.state());\n+        exploredFront.put(node.state(), null);\n+        exploredBack.put(revNode.state(), null);\n         Node<A, S> solutionNode;\n         while (!front.isEmpty() || !back.isEmpty()) {\n \n             if (front.isEmpty() || back.isEmpty()) {\n-                return failure();\n+                this.previousMeetingOfTwoFrontiers = null;","path":"core/src/main/java/aima/core/search/basic/uninformed/BidirectionalSearch.java","position":57,"original_position":57,"commit_id":"a610f782d51863d54d57bb5b9b3aefa0f24db139","original_commit_id":"a610f782d51863d54d57bb5b9b3aefa0f24db139","user":{"login":"ctjoreilly","id":852923,"avatar_url":"https://avatars2.githubusercontent.com/u/852923?v=3","gravatar_id":"","url":"https://api.github.com/users/ctjoreilly","html_url":"https://github.com/ctjoreilly","followers_url":"https://api.github.com/users/ctjoreilly/followers","following_url":"https://api.github.com/users/ctjoreilly/following{/other_user}","gists_url":"https://api.github.com/users/ctjoreilly/gists{/gist_id}","starred_url":"https://api.github.com/users/ctjoreilly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctjoreilly/subscriptions","organizations_url":"https://api.github.com/users/ctjoreilly/orgs","repos_url":"https://api.github.com/users/ctjoreilly/repos","events_url":"https://api.github.com/users/ctjoreilly/events{/privacy}","received_events_url":"https://api.github.com/users/ctjoreilly/received_events","type":"User","site_admin":false},"body":"I think you should still use a failure() method here, which implements its own interpretation of how failure is represented for this algorithm (all empty lists returned should suffice). I realize you are doing this due to implementing BidirectionalActions interface but this should be cleaned up.","created_at":"2017-03-15T13:44:38Z","updated_at":"2017-03-15T13:57:49Z","html_url":"https://github.com/aimacode/aima-java/pull/266#discussion_r106167421","pull_request_url":"https://api.github.com/repos/aimacode/aima-java/pulls/266","_links":{"self":{"href":"https://api.github.com/repos/aimacode/aima-java/pulls/comments/106167421"},"html":{"href":"https://github.com/aimacode/aima-java/pull/266#discussion_r106167421"},"pull_request":{"href":"https://api.github.com/repos/aimacode/aima-java/pulls/266"}}},"pull_request":{"url":"https://api.github.com/repos/aimacode/aima-java/pulls/266","id":110604495,"html_url":"https://github.com/aimacode/aima-java/pull/266","diff_url":"https://github.com/aimacode/aima-java/pull/266.diff","patch_url":"https://github.com/aimacode/aima-java/pull/266.patch","issue_url":"https://api.github.com/repos/aimacode/aima-java/issues/266","number":266,"state":"open","locked":false,"title":"BidirectionalActions implemented","user":{"login":"Manthan-R-Sheth","id":8593057,"avatar_url":"https://avatars2.githubusercontent.com/u/8593057?v=3","gravatar_id":"","url":"https://api.github.com/users/Manthan-R-Sheth","html_url":"https://github.com/Manthan-R-Sheth","followers_url":"https://api.github.com/users/Manthan-R-Sheth/followers","following_url":"https://api.github.com/users/Manthan-R-Sheth/following{/other_user}","gists_url":"https://api.github.com/users/Manthan-R-Sheth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manthan-R-Sheth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manthan-R-Sheth/subscriptions","organizations_url":"https://api.github.com/users/Manthan-R-Sheth/orgs","repos_url":"https://api.github.com/users/Manthan-R-Sheth/repos","events_url":"https://api.github.com/users/Manthan-R-Sheth/events{/privacy}","received_events_url":"https://api.github.com/users/Manthan-R-Sheth/received_events","type":"User","site_admin":false},"body":"This is an initial approach for implementing BidirectionalActions interface.","created_at":"2017-03-14T11:55:23Z","updated_at":"2017-03-15T13:57:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa142a1f057caed108e141e8a0c3121d7a1ab544","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aimacode/aima-java/pulls/266/commits","review_comments_url":"https://api.github.com/repos/aimacode/aima-java/pulls/266/comments","review_comment_url":"https://api.github.com/repos/aimacode/aima-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aimacode/aima-java/issues/266/comments","statuses_url":"https://api.github.com/repos/aimacode/aima-java/statuses/a610f782d51863d54d57bb5b9b3aefa0f24db139","head":{"label":"Manthan-R-Sheth:implementation","ref":"implementation","sha":"a610f782d51863d54d57bb5b9b3aefa0f24db139","user":{"login":"Manthan-R-Sheth","id":8593057,"avatar_url":"https://avatars2.githubusercontent.com/u/8593057?v=3","gravatar_id":"","url":"https://api.github.com/users/Manthan-R-Sheth","html_url":"https://github.com/Manthan-R-Sheth","followers_url":"https://api.github.com/users/Manthan-R-Sheth/followers","following_url":"https://api.github.com/users/Manthan-R-Sheth/following{/other_user}","gists_url":"https://api.github.com/users/Manthan-R-Sheth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manthan-R-Sheth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manthan-R-Sheth/subscriptions","organizations_url":"https://api.github.com/users/Manthan-R-Sheth/orgs","repos_url":"https://api.github.com/users/Manthan-R-Sheth/repos","events_url":"https://api.github.com/users/Manthan-R-Sheth/events{/privacy}","received_events_url":"https://api.github.com/users/Manthan-R-Sheth/received_events","type":"User","site_admin":false},"repo":{"id":83442531,"name":"aima-java","full_name":"Manthan-R-Sheth/aima-java","owner":{"login":"Manthan-R-Sheth","id":8593057,"avatar_url":"https://avatars2.githubusercontent.com/u/8593057?v=3","gravatar_id":"","url":"https://api.github.com/users/Manthan-R-Sheth","html_url":"https://github.com/Manthan-R-Sheth","followers_url":"https://api.github.com/users/Manthan-R-Sheth/followers","following_url":"https://api.github.com/users/Manthan-R-Sheth/following{/other_user}","gists_url":"https://api.github.com/users/Manthan-R-Sheth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manthan-R-Sheth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manthan-R-Sheth/subscriptions","organizations_url":"https://api.github.com/users/Manthan-R-Sheth/orgs","repos_url":"https://api.github.com/users/Manthan-R-Sheth/repos","events_url":"https://api.github.com/users/Manthan-R-Sheth/events{/privacy}","received_events_url":"https://api.github.com/users/Manthan-R-Sheth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Manthan-R-Sheth/aima-java","description":"Java implementation of algorithms from Russell And Norvig's \"Artificial Intelligence - A Modern Approach\"","fork":true,"url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java","forks_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/forks","keys_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/teams","hooks_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/hooks","issue_events_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/issues/events{/number}","events_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/events","assignees_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/assignees{/user}","branches_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/branches{/branch}","tags_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/tags","blobs_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/statuses/{sha}","languages_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/languages","stargazers_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/stargazers","contributors_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/contributors","subscribers_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/subscribers","subscription_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/subscription","commits_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/contents/{+path}","compare_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/merges","archive_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/downloads","issues_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/issues{/number}","pulls_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/pulls{/number}","milestones_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/milestones{/number}","notifications_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/labels{/name}","releases_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/releases{/id}","deployments_url":"https://api.github.com/repos/Manthan-R-Sheth/aima-java/deployments","created_at":"2017-02-28T14:34:54Z","updated_at":"2017-02-28T14:34:58Z","pushed_at":"2017-03-14T16:56:32Z","git_url":"git://github.com/Manthan-R-Sheth/aima-java.git","ssh_url":"git@github.com:Manthan-R-Sheth/aima-java.git","clone_url":"https://github.com/Manthan-R-Sheth/aima-java.git","svn_url":"https://github.com/Manthan-R-Sheth/aima-java","homepage":"","size":142830,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":false,"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":"AIMA3e"}},"base":{"label":"aimacode:AIMA4e","ref":"AIMA4e","sha":"fcbd115ceefe63aea42142deeea26b5e3f19f505","user":{"login":"aimacode","id":17015933,"avatar_url":"https://avatars1.githubusercontent.com/u/17015933?v=3","gravatar_id":"","url":"https://api.github.com/users/aimacode","html_url":"https://github.com/aimacode","followers_url":"https://api.github.com/users/aimacode/followers","following_url":"https://api.github.com/users/aimacode/following{/other_user}","gists_url":"https://api.github.com/users/aimacode/gists{/gist_id}","starred_url":"https://api.github.com/users/aimacode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aimacode/subscriptions","organizations_url":"https://api.github.com/users/aimacode/orgs","repos_url":"https://api.github.com/users/aimacode/repos","events_url":"https://api.github.com/users/aimacode/events{/privacy}","received_events_url":"https://api.github.com/users/aimacode/received_events","type":"Organization","site_admin":false},"repo":{"id":32103526,"name":"aima-java","full_name":"aimacode/aima-java","owner":{"login":"aimacode","id":17015933,"avatar_url":"https://avatars1.githubusercontent.com/u/17015933?v=3","gravatar_id":"","url":"https://api.github.com/users/aimacode","html_url":"https://github.com/aimacode","followers_url":"https://api.github.com/users/aimacode/followers","following_url":"https://api.github.com/users/aimacode/following{/other_user}","gists_url":"https://api.github.com/users/aimacode/gists{/gist_id}","starred_url":"https://api.github.com/users/aimacode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aimacode/subscriptions","organizations_url":"https://api.github.com/users/aimacode/orgs","repos_url":"https://api.github.com/users/aimacode/repos","events_url":"https://api.github.com/users/aimacode/events{/privacy}","received_events_url":"https://api.github.com/users/aimacode/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aimacode/aima-java","description":"Java implementation of algorithms from Russell And Norvig's \"Artificial Intelligence - A Modern Approach\"","fork":false,"url":"https://api.github.com/repos/aimacode/aima-java","forks_url":"https://api.github.com/repos/aimacode/aima-java/forks","keys_url":"https://api.github.com/repos/aimacode/aima-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aimacode/aima-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aimacode/aima-java/teams","hooks_url":"https://api.github.com/repos/aimacode/aima-java/hooks","issue_events_url":"https://api.github.com/repos/aimacode/aima-java/issues/events{/number}","events_url":"https://api.github.com/repos/aimacode/aima-java/events","assignees_url":"https://api.github.com/repos/aimacode/aima-java/assignees{/user}","branches_url":"https://api.github.com/repos/aimacode/aima-java/branches{/branch}","tags_url":"https://api.github.com/repos/aimacode/aima-java/tags","blobs_url":"https://api.github.com/repos/aimacode/aima-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aimacode/aima-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aimacode/aima-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/aimacode/aima-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aimacode/aima-java/statuses/{sha}","languages_url":"https://api.github.com/repos/aimacode/aima-java/languages","stargazers_url":"https://api.github.com/repos/aimacode/aima-java/stargazers","contributors_url":"https://api.github.com/repos/aimacode/aima-java/contributors","subscribers_url":"https://api.github.com/repos/aimacode/aima-java/subscribers","subscription_url":"https://api.github.com/repos/aimacode/aima-java/subscription","commits_url":"https://api.github.com/repos/aimacode/aima-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/aimacode/aima-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/aimacode/aima-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/aimacode/aima-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/aimacode/aima-java/contents/{+path}","compare_url":"https://api.github.com/repos/aimacode/aima-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aimacode/aima-java/merges","archive_url":"https://api.github.com/repos/aimacode/aima-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aimacode/aima-java/downloads","issues_url":"https://api.github.com/repos/aimacode/aima-java/issues{/number}","pulls_url":"https://api.github.com/repos/aimacode/aima-java/pulls{/number}","milestones_url":"https://api.github.com/repos/aimacode/aima-java/milestones{/number}","notifications_url":"https://api.github.com/repos/aimacode/aima-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aimacode/aima-java/labels{/name}","releases_url":"https://api.github.com/repos/aimacode/aima-java/releases{/id}","deployments_url":"https://api.github.com/repos/aimacode/aima-java/deployments","created_at":"2015-03-12T21:25:57Z","updated_at":"2017-03-15T11:40:32Z","pushed_at":"2017-03-15T13:33:13Z","git_url":"git://github.com/aimacode/aima-java.git","ssh_url":"git@github.com:aimacode/aima-java.git","clone_url":"https://github.com/aimacode/aima-java.git","svn_url":"https://github.com/aimacode/aima-java","homepage":"","size":144337,"stargazers_count":632,"watchers_count":632,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":352,"mirror_url":null,"open_issues_count":79,"forks":352,"open_issues":79,"watchers":632,"default_branch":"AIMA3e"}},"_links":{"self":{"href":"https://api.github.com/repos/aimacode/aima-java/pulls/266"},"html":{"href":"https://github.com/aimacode/aima-java/pull/266"},"issue":{"href":"https://api.github.com/repos/aimacode/aima-java/issues/266"},"comments":{"href":"https://api.github.com/repos/aimacode/aima-java/issues/266/comments"},"review_comments":{"href":"https://api.github.com/repos/aimacode/aima-java/pulls/266/comments"},"review_comment":{"href":"https://api.github.com/repos/aimacode/aima-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aimacode/aima-java/pulls/266/commits"},"statuses":{"href":"https://api.github.com/repos/aimacode/aima-java/statuses/a610f782d51863d54d57bb5b9b3aefa0f24db139"}}}}
{"actor":{"display_login":"ctjoreilly"}}