Skip to content

Conversation

@samagra14
Copy link
Contributor

@samagra14 samagra14 commented Jul 13, 2018

Adds algorithms from 4th edition chapters, numbered 3 and 4.

     _solution_ ← cutoff
     __else__
       __for__ _child_ __in__ successors(_parent_) __do__
         __if__ _child_ is a goal __then__
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@norvig
In the rest of the chapter, we check if a state is a goal state or not. However, in this algorithm, we have applied the test directly on a node. The test is applied as follows in the rest of the algorithms:
for child in successors(parent) do
    schild.state
   if s is a goal then
and then the rest of the code. Please have a look into this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be child.state here too.

 _solution_ ← failure
 __while__ _frontier_ is not empty __do__
   _parent_ ← the first node in _frontier_
   __for__ _child_ __in__ successors(_parent_) __do__
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@norvig
The successors function defined earlier in the draft takes problem and parent as its arguments. Please have a look.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we should probably be consistent, and thorough, and use problem as an argument to successors everywhere.

@norvig
Copy link
Contributor

norvig commented Jul 25, 2018

Looks good!

@norvig norvig merged commit 72206d6 into aimacode:master Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants