Listen

Description

(The below text version of the notes is for search purposes and convenience. See the PDF version for proper formatting such as bold, italics, etc., and graphics where applicable. Copyright: 2022 Retraice, Inc.)


Re83: A Problem Instantiated
(Best-First-Search Part 2, AIMA4e pp. 73-74)

retraice.com

Writing a well-defined problem, in Python, as an object that's an instance of the class Problem.
Object-oriented programming; class Problem as subclass of object, implementing structure of well-defined problem; initial state and goal state as attributes in Problem; the four functions Actions(), Result(), Is-Goal() and Action-Cost(), and the informed search function h(), as methods in Problem.

Air date: Thursday, 15th Dec. 2022, 10:00 PM Eastern/US.

The structure of a problem^1

* state space: a set of possible states of the environment;
* initial state: the state in which the agent starts;
* goal state(s): a set of one or more; account for one, some, infinite (by means of a property) by specifying Is-Goal method for problem;
* actions: what the agent can do; Actions(state) returns a finite set of actions that can be executed in state;
* transition model: describes what actions do; Result(state,action) returns the state s' that results from doing action in state;
* action cost function: Action-Cost(s,a,s') gives the numeric cost of applying action a in state s to reach new state s'. Cf. the evaluation function, which we'll use to prioritize our nodes for next expansion, and the objective function, which was our cost measure to be minimized in the airport problem.^2

Problem implemented in Python
________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

PIC
________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Code available at https://github.com/retraice/ReAIMA4e.
Adapted from https://github.com/aimacode/aima-python/blob/master/search4e.ipynb.

__

References

Retraice (2022/12/11). Re78: Recap of Gradients and Partial Derivatives (AIMA4e pp. 119-122). retraice.com.
https://www.retraice.com/segments/re78Retrieved 12th Dec. 2022.

Retraice (2022/12/14). Re82: What is a problem? (BEST-FIRST-SEARCH Part 1, AIMA4e pp. 73-74). retraice.com.
https://www.retraice.com/segments/re82Retrieved 15th Dec. 2022.

Russell, S., & Norvig, P. (2020). Artificial Intelligence: A Modern Approach. Pearson, 4th ed. ISBN: 978-0134610993. Searches:
https://www.amazon.com/s?k=978-0134610993
https://www.google.com/search?q=isbn+978-0134610993
https://lccn.loc.gov/2019047498

Footnotes

^1 Adapted from Russell & Norvig (2020) p. 65. See also Retraice (2022/12/14).

^2 Retraice (2022/12/11).