1. Engineering
  2. Computer Science
  3. problem 2 a robot moves around in a confined space...

Question: problem 2 a robot moves around in a confined space...

Question details

Problem 2) A robot moves around in a confined space (shown in diagram below) which can be represented using a 10 X 10 grid of cells where the cells marked X are unsurpassable walls (thus the diagram shows walls surrounding the space and also a wall inside the space). At any given time the robot is located inside a non-wall cell and faces one of four directions- north, south, east or west. The robot can act in one of two ways - (i) turn to face one of two directions from whichever direction it was facing by rotating 90 degress clockwise or counter-clockwise (i.e. from facing north it can face east or west, from facing east it can face north or south etc.) or (ii move to the next non-wall cell it is facing. Additionally, as shown in the diagram, the robot starts in the cell labeled S facing East and its goal is to reach the cell labeled G (it does not matter what direction it faces once it lands inside G). Your task is to (a) create a correct way of representing the state of the robot (b) write down an optimal path (as a sequence of states) from the starting state to goal state assuming that the cost of a turn and a move are both 1 (c write down an optimal path (as a sequence of states) from the starting state to goal state assuming that the cost of a turn is 2 and the cost of a move is 1 North East West G X South
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution