edu.columbia.cs.coms4701.agent.environments.robot
Interface RobotSuccessPercept

All Superinterfaces:
AgentPercept, RobotPercept
All Known Implementing Classes:
RoombaSuccessPercept

public interface RobotSuccessPercept
extends RobotPercept

A percept indicating whether the last attempted action was successful or not, and if not, why.

Apart from the initial percept of starting location, this will be the only type of percept your robot receives. The percept is a simple indication of success or failure of the last attempted action. If the action succeeded, you can assume that your robot successfully changed position. If the action failed, you can obtain additional information about why (due hitting on obstacle, or hitting the boundary of the room).

Version:
0.1

User: aaron Date: Aug 25, 2006 Time: 1:54:13 PM

Author:
aaron@cs

Nested Class Summary
static class RobotSuccessPercept.ReasonForFailure
           
 
Method Summary
 RobotSuccessPercept.ReasonForFailure getReasonForFailure()
          Indicates the reason for the failure of an attempted move.
 java.lang.Boolean wasSuccessful()
          Indicates whether the last action attempted by the robot was successful or not.
 

Method Detail

wasSuccessful

java.lang.Boolean wasSuccessful()
Indicates whether the last action attempted by the robot was successful or not.

Returns:
true if the robot's last chosen action succeeded, i.e. the robot can assume it has moved squares; false otherwise.

getReasonForFailure

RobotSuccessPercept.ReasonForFailure getReasonForFailure()
Indicates the reason for the failure of an attempted move.

Should return null if the move was *not* a failure

Returns:
HitObstacle if the destination square contained an obstacle, and IllegalMove if the move was invalid (e.g. would go beyond boundaries)