Lab 4: State representation
Objective
-
To represent the state of a vacuum world.
-
To solve the vacuum world problem using breadth-first search.
Problem
The following image represents one of the possible states of a two-square vacuum world.
The aim of this section is to create a code to search for solution for the vacuum world given an initial state. Consider the actions left, right, suck, and every action contributes the same cost.
-
How could we represent the state?
-
Do we need to define the whole state space statically?
-
How do we define the transition model? The transition model should be a function that takes the
state
andaction
as inputs and returns the resultstate
.
Create the code to solve a vacuum world problem using the breadth-first search. Execute it and investigate if it's working correctly.