Artificial Intelligence: A Modern Approach
3rd Edition
ISBN: 9780136042594
Author: Stuart Russell, Peter Norvig
Publisher: Prentice Hall
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 2, Problem 7E
Explanation of Solution
Pseudocode agent
- For fully-observable and fully-known static environments a policy can be computed in advance which gives the action to taken in any given state.\
- The pseudocode program is
function GOAL-BASED-AGENT(percept ) returns an action
persistent: state, the agent’s current conception of the world state model , a description of how the next state depends on current state and action goal , a description of the desired goal state plan,...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
c. Write pseudo code for an agent program that works for “The number guessing game” as follows:
We want to build a computer program so that the robot could play a number guessing game. The game is as follows: the (human) player comes up with a whole number between 1 and 500 in their mind. The robot will repeatedly make a guess, say 200; after every guess, the human player provides feedback to the robot saying whether its guess was correct (=200), too small (>200) or too large (
Write a Java program to simulate the behavior of a model-based agent for a vacuum cleaner environment based on the following conditions:
The vacuum cleaner can move to one of 4 squares: A, B, C, or D as shown in Table 1.
Table 1: vacuum cleaner environment
A
B
C
D
The vacuum cleaner checks the status of all squares and takes action based on the following order:
If all squares are clean, the vacuum cleaner stays in its current location.
If the current location is not clean, the vacuum cleaner stays in its current location to clean it up.
The vacuum cleaner can only move horizontally or vertically (cannot move diagonally).
The vacuum cleaner moves only one square at a time.
Horizontal moves have the highest priority over vertical moves.
The vacuum cleaner moves to another square only when it needs to be cleaned up. If a diagonal square needs to be cleaned up, the vacuum cleaner moves to its neighbor vertical square first.
The vacuum cleaner action is…
Write code in Python for Blind Dog Agent:
Create an agent blind-dog who can only feel what's in his location (since he's blind) and can eat or drink.
The blind-dog is hungry and needs to search for food. But before that, let's create an environment for the blind-dog to play in. The blind-dog can perceive and act upon the environment. The environment contains some food, water, and the blind-dog
The Blind-Dog to be able to randomly move down and eat food or drink water only if it is present.
The bling-dog first eat the food and then drink the water after eating the food.
Chapter 2 Solutions
Artificial Intelligence: A Modern Approach
Ch. 2 - Suppose that the performance measure is concerned...Ch. 2 - Let us examine the rationality of various...Ch. 2 - Prob. 3ECh. 2 - For each of the following activities, give a PEAS...Ch. 2 - Define in your own words the following terms:...Ch. 2 - Prob. 6ECh. 2 - Prob. 7ECh. 2 - Implement a performance-measuring environment...Ch. 2 - Prob. 9ECh. 2 - Prob. 10E
Knowledge Booster
Similar questions
- Q1: Can there be more than one agent program that implements a given agent function? Q2: Given a fixed machine architecture, does each agent program implement exactly one agent function?arrow_forwardthe knowledge-based agent is not an arbitrary program for calculating actions. It is amenable to a description at the knowledge level, where we need specify only what the agent knows and what it goains are, in order to fix its behavior. Give an Example:arrow_forwardThe wolf-goat-cabbage ProblemDescription of the problem: There is a farmer who wishes to cross a river but he is not alone. He also has a goat, a wolf, and a cabbage along with him. There is only one boat available which can support the farmer and either of the goat, wolf or the cabbage. So at a time, the boat can have only two objects (farmer and one other). But the problem is, if the goat and wolf are left alone (either in the boat or onshore), the wolf will eat the goat. Similarly, if the goat and cabbage are left alone, then goat will eat the cabbage. The farmer wants to cross the river with all three of his belongings: goat, wolf, and cabbage.Complete the state space of this problem. The green state is valid state (you should expand it until to reach the goal state) and orange state is invalid state (you should not expand it).• w: wolf• g: goat• c: cabbage• f: framer• ||: rive.arrow_forward
- In programming, we use the mask concept to indicate information that can be shown to the user and information that must be “masked”, that is, hidden. In an implementation of a hangman game, we use a mask to indicate which secret word positions the player has already guessed right (whose the contents must therefore be shown to the player), and which positions must remain hidden. Each time that the player hits a letter of the hidden word, the mask is updated so that it has little dashes in the places of letters that the player has not hit yet and show it, in their proper place, the letters that he already hit it. For example, if the word is "cards", the current mask is: - a - - s and the player guesses the letter "d", the mask should be updated to: - a - ds.Write a function called update_mask that takes as input a string containing the word secret (in the example above, this word would be “cards”), a list whose elements are the characters of the current mask (in the example above…arrow_forwardImplement the class as depicted in the UML diagram. Apartment -city: String -area: double -nbOfRooms: int -duplex: boolean +num apt: int +Apartment(----All data fields----) +getCity(): String +getNumberOfStories(): int +assessSize(): String +printDescription(): void 2/3 Data Fields: 1. city: It may consist of one word or two such as "Beirut", "Bint Jbeil", etc. 2. area: its value is expressed in square meter 3. nbOfRooms: with maximum value of 10 4. duplex: either true or false to reflect whether the apartment is made of two stories or only a single one. 5. num_apt: to keep track of how many apartment objects were created. Methods: 1. A constructor that creates an Apartment object with the specified values of all data fields. If the number of rooms passed is greater than 10, then nbOfRooms is set to 0. 2. getCity(): this method returns the city with its letters all capitalized. 3. getNumberOfStories(): This method returns the number of stories of an apartment. If it is duplex, then 2…arrow_forwardWrite a Java program to simulate the behaviour of a model-based agent for a vacuum cleaner environment based on the following conditions: The vacuum cleaner can move to one of 4 squares: A, B, C, or D as shown in Table 1. Table 1: vacuum cleaner environment A B C D The vacuum cleaner checks the status of all squares and takes action based on the following order: If all squares are clean, the vacuum cleaner stays in its current location. If the current location is not clean, the vacuum cleaner stays in its current location to clean it up. The vacuum cleaner can only move horizontally or vertically (cannot move diagonally). The vacuum cleaner moves only one square at a time. Horizontal moves have the highest priority over vertical moves. The vacuum cleaner moves to another square only when it needs to be cleaned up. If a diagonal square needs to be cleaned up, the vacuum cleaner moves to its neighbour vertical square first. The vacuum cleaner action is…arrow_forward
- Write a Java program to simulate the behaviour of a model-based agent for a vacuum cleaner environment based on the following conditions: The vacuum cleaner can move to one of 4 squares: A, B, C, or D as shown in Table 1. Table 1: vacuum cleaner environment A B C D The vacuum cleaner checks the status of all squares and takes action based on the following order: If all squares are clean, the vacuum cleaner stays in its current location. If the current location is not clean, the vacuum cleaner stays in its current location to clean it up. The vacuum cleaner can only move horizontally or vertically (cannot move diagonally). The vacuum cleaner moves only one square at a time. Horizontal moves have the highest priority over vertical moves. The vacuum cleaner moves to another square only when it needs to be cleaned up. If a diagonal square needs to be cleaned up, the vacuum cleaner moves to its neighbour vertical square first. The vacuum cleaner action is…arrow_forwardthe knowledge-based agent is not an arbitrary program for calculating actions. It is amenable to a description at the knowledge level, where we need specify only what the agent knows and what its goals are, in order to fix its behavior. Give an Example ?arrow_forwardTask: Implement given class diagram in java language and write definitions of necessary methods. «interface Payable +getPaymentAmount(): double Employee -firstName: String -lastName: String socialSecurityNumber: String Invoice partNumber: String |-partDescription: String -quantity: int -pricePertem: double CommissionEmployee -grossSales: double commissionRate: doublearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr