Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part2: Write a program (preferably in Python, if not Java) which automatically generates the search map for the robot and then finds the shortest path

image text in transcribed

Part2: Write a program (preferably in Python, if not Java) which automatically generates the search map for the robot and then finds the shortest path using Grassfire algorithm.

Here are the steps to generate the search map based on the inputs from the user:

Step1: divide the search region in grid cells:

User enters the size of the region as the dimensions of the grid. This means user should provide the number of rows and columns. The minimum size should be 8x8.

Step 2: identify the obstacle cells

Use provides a random number as the percentage of the obstacle cells. This can be any percentage in the range of 10% to 20%. In your program, you can round up the user input to make it an integer number. Based on this number, generate a random list of pairs representing the row and column indices of the obstacle cells.

Step 3: initialize the starting cell

User enters a random number less than the number of columns which represents a cell in the first row as the starting cellode.

Step 4: initialize the destination cell

User provides the index of row and column for the destination node. To this end, the row index should be a random number greater than half of the number of rows (i.e., if the number of rows is 10, the row index for the destination cell should be greater than 5) and the column index is greater than 2/3 of the number of columns (i.e., if the number of columns is 10, the column index for the destination cell should be greater than 6.6 which should be round up to 7).

The program should output the searched map (graphically or in matrix format) and then print the solutions corresponding to the shortest path(s) using Grassfire algorithm.

Part 3: Make a GUI for part 2 with nice graphics for the search map and also the results.

Part1: A robot is constrained to move in the given 2D grid and not hitting the obstacles/barri (i.e., black cells). Use the Grassfire algorithm and find all the shortest paths that the robot cou take to go from the START node (Green) to the GOAL node (Red). You need to do this part by hand and identify all the possible path solutions

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Question

What are the benefits of a business plan for a company?

Answered: 1 week ago

Question

What steps should be taken to address any undesirable phenomena?

Answered: 1 week ago