Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a constructor __init__(self, depth_limit) that constructs a new Searcherobject by initializing the following attributes: an attribute states for the Searchers list of untested states;

Write a constructor __init__(self, depth_limit) that constructs a new Searcherobject by initializing the following attributes:

an attribute states for the Searchers list of untested states; it should be initialized to an empty list

an attribute num_tested that will keep track of how many states the Searcher tests; it should be initialized to 0

an attribute depth_limit that specifies how deep in the state-space search tree the Searcher will go; it should be initialized to the value specified by the parameter depth_limit. (A depth_limit of -1 will be used to indicate that the Searcher does not use a depth limit.)

Because weve already given you an __repr__ method for the class, you should be able to test your constructor as follows:

>>> searcher1 = Searcher(-1) # -1 means no depth limit >>> searcher1 Searcher: 0 untested, 0 tested, no depth limit >>> searcher2 = Searcher(10) >>> searcher2 Searcher: 0 untested, 0 tested, depth limit = 10

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

Students also viewed these Databases questions

Question

6. What is process reengineering? Why is it relevant to training?

Answered: 1 week ago