Skip to content

AIMA4e Search - #431

Merged
norvig merged 16 commits into
aimacode:AIMA4efrom
samagra14:generic_search
Aug 4, 2018
Merged

norvig merged 16 commits into
aimacode:AIMA4efrom
samagra14:generic_search

Conversation

@samagra14

Copy link
Copy Markdown
Collaborator

This PR adds the generic search algorithm to the AIMA4e branch. For testing, the generic search is extended as bfs and dfs. It is then applied to the Romania problem.

@samagra14

Copy link
Copy Markdown
Collaborator Author

@norvig Please have a look.
Should I remove Tree search and graph search from AIMA4e or should they coexist alongside generic search?

@samagra14 samagra14 changed the title Generic search AIMA4e Search Jul 15, 2018
((LinkedList<Node>) frontier).add(nodeFactory.newRootNode(problem.initialState()));
// reached ← a set of states; initially empty
HashSet<S> reached = new HashSet<>();
// solution ← failure

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this style, where the comments duplicate the code. I think it is good to have the pseudocode in a block comment, but then the Java implementation should stand by itself. Any Java programmer knows what reached = new HashSet<>(); means; we don't need to duplicate that in the comments.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@norvig
Sure, sir, I will have these duplicate comments removed. I added them just because of the older versions. I will have them removed.

@samagra14

Copy link
Copy Markdown
Collaborator Author

@norvig
This PR concludes all the modified algorithms.

  1. I have removed a lot of unwanted interfaces(for eg SearchController etc).
  2. Implemented informed search from scratch as opposed to extending uniform cost search.
  3. AndOrGraphSearch and the algorithms after that have not been modified in the draft and hence I have not modified their implementation. All other algorithms have been modified.
    5 Removed unwanted comments.
  4. In a few algorithms, I have kept the older testSuite as it was quite exhaustive.
    Please review this PR.

@samagra14

Copy link
Copy Markdown
Collaborator Author

@norvig
Is there anything else that needs to be corrected and/or added in this PR?

@norvig

norvig commented Aug 4, 2018

Copy link
Copy Markdown
Member

Looks good!

@norvig
norvig merged commit a2b3bb0 into aimacode:AIMA4e Aug 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants