Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SOLVE IN MATLAB USING INSTRUCTIONS BELOW 1 Maze Generation program will take the following arguments from the command line: nrRows nrCols maze.txt where nrRows is

SOLVE IN MATLAB USING INSTRUCTIONS BELOW

image text in transcribed

1 Maze Generation program will take the following arguments from the command line: nrRows nrCols maze.txt where nrRows is the number of rows, nrCols is the number of columns, and maze.txt is the name of the output file. You should use Depth First Search to generate a random maze. The maze should then be written to the file maze.txt. The format of the output file is as follows: The first line contains the number of rows and the number of columns e second line contains the number of remaining lines in the file e each line from the third to the last contains the row index, the column index, and a string describing which walls are up. For example, the line 2 3 LRU indicates that the cell in row 2 and column 3 has the left, right, and up walls. You should use - L for the left wall - R for the right wall - U for the up wall - D for the down wall If a cell has no wall, then you do not need to specify it in the input file. If you do, then you can write none after its coordinates to indicate that it has no walls. An example is provided in SupportCode/maze.txt 2 Maze Search The program will take the following arguments from the command line method maze.txt rstart cstart rend cend path.txt where method is the name of the search method, maze.txt is the name of the file with the maze, rstart is the row index of the start position, cstart is the column index of the start position, rend is the row index of the end position, cend is the column index of the end position. The method name is as follows: DFS for depth-first search, BFS for breadth-first search, AStarZero for A*-search with the zero heuristic, and AStarEuclidean for At-search with the Euclidean heuristic. The program should read the file maze.txt and search for a solution from (rstart,cstart) to (rend, cend It should then write the solution to the file path.txt. The format of the output file is as follows: first line contains the number of elements in the path . each line from the second to the last contains the row index and the column index of the i-th cell in the path An example is provided in SupportCode/path.txt 1 Maze Generation program will take the following arguments from the command line: nrRows nrCols maze.txt where nrRows is the number of rows, nrCols is the number of columns, and maze.txt is the name of the output file. You should use Depth First Search to generate a random maze. The maze should then be written to the file maze.txt. The format of the output file is as follows: The first line contains the number of rows and the number of columns e second line contains the number of remaining lines in the file e each line from the third to the last contains the row index, the column index, and a string describing which walls are up. For example, the line 2 3 LRU indicates that the cell in row 2 and column 3 has the left, right, and up walls. You should use - L for the left wall - R for the right wall - U for the up wall - D for the down wall If a cell has no wall, then you do not need to specify it in the input file. If you do, then you can write none after its coordinates to indicate that it has no walls. An example is provided in SupportCode/maze.txt 2 Maze Search The program will take the following arguments from the command line method maze.txt rstart cstart rend cend path.txt where method is the name of the search method, maze.txt is the name of the file with the maze, rstart is the row index of the start position, cstart is the column index of the start position, rend is the row index of the end position, cend is the column index of the end position. The method name is as follows: DFS for depth-first search, BFS for breadth-first search, AStarZero for A*-search with the zero heuristic, and AStarEuclidean for At-search with the Euclidean heuristic. The program should read the file maze.txt and search for a solution from (rstart,cstart) to (rend, cend It should then write the solution to the file path.txt. The format of the output file is as follows: first line contains the number of elements in the path . each line from the second to the last contains the row index and the column index of the i-th cell in the path An example is provided in SupportCode/path.txt

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions