0

This is the vacuum cleaner example of the book "Artificial intelligence: A Modern Approach" (4th edition).

enter image description here

Consider the simple vacuum-cleaner agent that cleans a square if it is dirty and moves to the other square if not; this is the agent function tabulated as follows.

Percept sequence                      Action
[A,Clean]                             Right
[A,Dirty]                             Suck
[B,Clean]                             Left
[B,Dirty]                             Suck
[A,Clean], [A,Clean]                  Right
[A,Clean], [A,Dirty]                  Suck
.                                      .
.                                      .
[A,Clean], [A,Clean], [A,Clean]       Right
[A,Clean], [A,Clean], [A,Dirty]       Suck
.                                      .    
.   
                               .

The characteristics of environment and performance function are as follow:

  • The performance measure awards one point for each clean square at each time step, over a "lifetime" of 1000 time steps.

  • The "geography" of the environment is known a priori (the above figure) but the dirt distribution and the initial location of the agent are not. Clean squares stay clean and sucking cleans the current square. The Right and Left actions move the agent one square except when this would take the agent outside the environment, in which case the agent remains where it is.

  • The only available actions are Right, Left, and Suck.

  • The agent correctly perceives its location and whether that location contains dirt.

In the book, it is stated that under these circumstances the agent is indeed rational. But I do not understand such percept sequence that consists of multiple [A, clean] percepts, e.g. {[A, clean], [A, clean]}. In my opinion, after first [A, clean], the agent must be gone to the right square; So, the sequence {[A, clean], [A, clean]} will never be perceived.

In other words, the second perception of [A, clean] is the consequence of acting left or suck action after perceiving the first [A, clean]. Therefore, we can conclude the agent is not rational.

Please, help me to understand it.

nbro
  • 39,006
  • 12
  • 98
  • 176
user153245
  • 123
  • 8

1 Answers1

1

You are correct that the robot should never perceive two [A, Clean] events in a row, as it should have moved when perceiving the first one.

However, this only applies to a perfect agent, which always successfully executes all its actions. What if the dog walks past and blocks the exit to room B? Then the Right action fails, and the agent is still in A. But now, it might only listen to [B, ?] events, because obviously it must now be in room B, since it executed a Right command.

Having a simple tabulated agent function like this is clearly not adequate for real world problems, as where do you stop? How many [A, Clean] events do you want to list? And, if you start again, why do you have lists of perceptions in the first place? The initial [A, Clean] in the list should suffice, as it would still attempt to move right if it processes perceptions with no internal state/memory.

But bearing in mind that physical actions can fail in the real world, the agent is still rational, it's just overly cautious: it doesn't try to suck when the location is clean, or move away when it's dirty. It just wants to make sure it's really clean before moving away.

Oliver Mason
  • 5,322
  • 12
  • 32
  • Thank you for the answer. But in the assumptions we have: "The Right and Left actions move the agent one square except when this would take the agent outside the environment, in which case the agent remains where it is." So it seems that the closure can not occur. What is your opinion? – user153245 Oct 24 '21 at 04:04