Define a state for a library cart route
Keep the names of states and actions distinct. · 200 words
In applied artificial intelligence, a state is a snapshot of the facts needed to choose the next action. For a library cart route, it can record the cart's location, the books on board, and the books still undelivered. An action creates a successor state. For example, (desk, empty, red atlas pending) becomes (desk, red atlas, red atlas pending) after pickup. Moving south gives (south aisle, red atlas, red atlas pending). Delivering the atlas there finally gives (south aisle, empty, none pending). A goal test checks whether all required deliveries are complete.
State design should include every fact that changes legal actions, costs, or success. Suppose one cart is at the desk carrying a red atlas, while another is two aisles away carrying a blue novel. They are different states because location and cargo differ. If every cart holds two books, the pickup rule can use that fixed limit and the current cargo count to rule out an impossible pickup. A goal state might be (history desk, no books, all deliveries complete). The search space is the set of reachable states, and a path links a start state to a goal state. Good definitions are neither too vague nor unnecessarily detailed.
Check your recall
What three kinds of facts could appear in the state of a library cart route, and what does the goal test examine?
Check your answer
The state can record the cart's location, its cargo, and the books still needing delivery. The goal test checks whether every required delivery has been completed.
Sources and credits
Original KeyTouch lesson. Background reading · UC Berkeley · Introduction to Artificial Intelligence.