foundations of computational agents
To reason about what to do, assume an agent has goals, a model of the environment, and a model of its actions.
A deterministic action is a partial function from states to states. It is partial because not every action is able to be carried out in every state. For example, a robot cannot pick up a particular object if it is nowhere near the object. The precondition of an action specifies when the action can be carried out. The effect of an action specifies the resulting state.
|Features to describe states – Rob’s location – Rob has coffee – Sam wants coffee – Mail is waiting – Rob has mail Actions – move clockwise – move counterclockwise – pickup coffee – deliver coffee – pickup mail – deliver mail|
The robot, called Rob, can buy coffee at the coffee shop, pick up mail in the mail room, move, and deliver coffee and/or mail. Delivering the coffee to Sam’s office will stop Sam from wanting coffee. There could be mail waiting at the mail room to be delivered to Sam’s office. This domain is quite simple, yet it is rich enough to demonstrate many of the issues in representing actions and in planning.
The state is described in terms of the following features.
, the robot’s location, which is one of the coffee shop (), Sam’s office (), the mail room (), or the laboratory ().
, whether the robot has coffee. The atom means Rob has coffee (i.e., ) and means Rob does not have coffee (i.e., ).
, whether Sam wants coffee. The atom means Sam wants coffee and means Sam does not want coffee.
, whether mail is waiting at the mail room. The atom means there is mail waiting and means there is no mail waiting.
, whether the robot is carrying the mail. The atom means Rob has mail, and means Rob does not have mail.
Rob has six actions.
Rob can move clockwise ().
Rob can move counterclockwise ().
Rob can pick up coffee if Rob is at the coffee shop. Let mean that Rob picks up coffee. The precondition of is ; that is, Rob can pick up coffee in any state where its location is , and it is not already holding coffee. The effect of this action is to make true. It does not affect the other features.
Rob can deliver coffee if Rob is carrying coffee and is at Sam’s office. Let mean that Rob delivers coffee. The precondition of is . The effect of this action is to make false and make false. Note that Rob can deliver coffee whether or not Sam wants it.
Rob can pick up mail if Rob is at the mail room and there is mail waiting there. Let mean Rob picks up the mail.
Rob can deliver mail if Rob is carrying mail and at Sam’s office. Let mean Rob delivers mail.
Assume that it is only possible for Rob to do one action at a time. We assume that a lower-level controller is able to implement these actions, as described in Chapter 2.