Introduction
With a suitable abstractions planning a path for a mobile robot can be converted into a search problem. Begin by abstracting the environment into 2D grid of square “cells”. The robot state can be represented by a [x,y] pair, with [0,0] being the top-left cell of the grid. Movements of the robot are possible at any time either UP, DOWN, LEFT RIGHT (denoted U, D, L, R) unless the neighbouring cell is occupied. The UP action moves to the cell immediately above (if possible) by changing [x,y] to [x,y-1]. Likewise RIGHT changes the current state from [x,y] to [x+1,y], and so on. Given a start state, the goal of the robot is to reach a new (user specified) state [X*, Y*], where this must be an unoccupied cell in the grid. An action that would take the robot outside the grid or into and occupied cell results in no change to the current state.
Your task is to write a program that will read in an environment, a start state and a goal state, and conduct a search to find a path between start and goal. You may implement any of the search algorithms discussed in lectures. Your output should be in the form of a space-separated list of actions (e.g. U R R D D L L).
Test data are provided on the course pages along with this Assignment description. A week before the deadline more data will be made available and you must run your code on these new data and include these results in your report (see below).
You must write the program yourself in either C, C++, Java or Python. If you use a library package or language function call for doing the search, you will be limited to 50% of the available marks (noting that this assignment is a hurdle for the course with min mark to achieve of hurdle of 45%). If there is evidence you have simply copied code from the web, you will be awarded no marks and referred for plagiarism.
The program must accept 5 arguments from the command-line, a filename (which contains the environment) and 4 integers specifying start state and goal state, eg:
./robotplanner env.txt 0 2 4 1