Write a program that implements the A* algorithm to find a path from any two given...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that implements the A* algorithm to find a path from any two given nodes. You may use any of the following languages: C++, C#, Java, ActionScript. Problem Overview & Algorithm Description In a fully-observable environment where there are both pathable and blocked nodes, an agent must find a good path from their starting node to the goal node. The agent must use the A* algorithm to determine its path. For this program, you must use the Manhattan method for calculating the heuristic. Remember: your heuristic function is a representation of how good or close you are to the goal state. Program Requirements No graphics are required for this program but using them will help you with debugging and problem solving. Your environment should be a 15x15 tile-based world that randomly generates nodes that are unpathable (blocks) in 10% of the nodes. This should be done each time the program compiles ensuring that there are different environment makeups each run. The program should display the generated environment when the program runs, and should allow the user to select a starting node and goal node. This can be done via text input into the console or with a GUI. Once the start and goal nodes have been defined, the program should run the A* algorithm to find a path. The path should be displayed (series of [x,y] nodes, highlighting nodes, or actually moving the agent) if one exists, or a message indicating that a path could not be found. The user should be able to continue specifying starting and goal nodes after paths have been found when the program runs, and should allow the user to select a starting node and goal node. This can be done via text input into the console or with a GUI. Once the start and goal nodes have been defined, the program should run the A* algorithm to find a path. The path should be displayed (series of [x,y] nodes, highlighting nodes, or actually moving the agent) if one exists, or a message indicating that a path could not be found. The user should be able to continue specifying starting and goal nodes after paths have been found public class Node { private int row, col, f, g, h, type; private Node parent; public Node(int r, int c, int t) { row = r; col = c; type=t; parent =null; //type 0 is traverseable, 1 is not } //mutator methods to set values public void setF(){ f= g + h; } public void setG(int value){ g = value; } public void setH(int value) { h= value; } public void setParent(Node n) { parent = n;} //accessor methods to get values public int getF(){ return f;} public int getG() { return g; } public int getH() { return h; } public Node getParent(){ return parent;} public int getRow(){ return row; } public int getCol(){ return col; } public boolean equals(Object in) { //typecast to Node Node n = (Node) in; return rown.getRow() && col = n.getCol(); } public String toString() { return "Node: " + row+"_ } 11 + col; } Write a program that implements the A* algorithm to find a path from any two given nodes. You may use any of the following languages: C++, C#, Java, ActionScript. Problem Overview & Algorithm Description In a fully-observable environment where there are both pathable and blocked nodes, an agent must find a good path from their starting node to the goal node. The agent must use the A* algorithm to determine its path. For this program, you must use the Manhattan method for calculating the heuristic. Remember: your heuristic function is a representation of how good or close you are to the goal state. Program Requirements No graphics are required for this program but using them will help you with debugging and problem solving. Your environment should be a 15x15 tile-based world that randomly generates nodes that are unpathable (blocks) in 10% of the nodes. This should be done each time the program compiles ensuring that there are different environment makeups each run. The program should display the generated environment when the program runs, and should allow the user to select a starting node and goal node. This can be done via text input into the console or with a GUI. Once the start and goal nodes have been defined, the program should run the A* algorithm to find a path. The path should be displayed (series of [x,y] nodes, highlighting nodes, or actually moving the agent) if one exists, or a message indicating that a path could not be found. The user should be able to continue specifying starting and goal nodes after paths have been found when the program runs, and should allow the user to select a starting node and goal node. This can be done via text input into the console or with a GUI. Once the start and goal nodes have been defined, the program should run the A* algorithm to find a path. The path should be displayed (series of [x,y] nodes, highlighting nodes, or actually moving the agent) if one exists, or a message indicating that a path could not be found. The user should be able to continue specifying starting and goal nodes after paths have been found public class Node { private int row, col, f, g, h, type; private Node parent; public Node(int r, int c, int t) { row = r; col = c; type=t; parent =null; //type 0 is traverseable, 1 is not } //mutator methods to set values public void setF(){ f= g + h; } public void setG(int value){ g = value; } public void setH(int value) { h= value; } public void setParent(Node n) { parent = n;} //accessor methods to get values public int getF(){ return f;} public int getG() { return g; } public int getH() { return h; } public Node getParent(){ return parent;} public int getRow(){ return row; } public int getCol(){ return col; } public boolean equals(Object in) { //typecast to Node Node n = (Node) in; return rown.getRow() && col = n.getCol(); } public String toString() { return "Node: " + row+"_ } 11 + col; }
Expert Answer:
Related Book For
Fundamentals of Investments Valuation and Management
ISBN: 978-0077283292
5th edition
Authors: Bradford D. Jordan, Thomas W. Miller
Posted Date:
Students also viewed these finance questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
How do you effectively conduct strategic sourcing?
-
In this project, we will write a program that controls a quiz show, much like the many popular TV shows. The program will read in a group of questions and their multiple choice answers, storing them...
-
Calculate the labour turnover rate according to replacement method from the following: No. of workers on the payroll: - At the beginning of the month: 500 - At the end of the month: 600 During the...
-
The rod is subjected to the forces shown. Determine the internal normal force at points A, B, andC. 550 Ib 150 lb 150 lb 350 lb 350 Ib
-
The Merlin rocket engines developed by SpaceX can produce 7.41 x 105 N of instantaneous thrust with an exhaust speed of 3.05 x 103 m/s in vacuum. What mass of fuel does the engine burn each second to...
-
Determine if the column can support the eccentric compressive load of \(1.5 \mathrm{kip}\). Assume that the bottom is fixed and the top is pinned. Use the NFPA equations in Sec. 13.6 and Eq. 13-30. 3...
-
Gray Brothers Products Inc. manufactures a liquid product in one department. Due to the nature of the product and the process, units are regularly lost at the beginning of production. Materials and...
-
Marigold, Inc. reports all its sales on credit, and pays operating costs in the month incurred. Amounts for 2022 are: March April May June July Budgeted sales $299500 $290000 $319700 $279100 $209800...
-
Letang Company has three divisions (R, S, and T), organized as decentralized profit centers. Division R produces the basic chemical Ranbax (in multiples of 1,000 pounds) and transfers it to Divisions...
-
10. Simply spoken the ECG means recording the voltage produced by the heart at the skin surface of the body = graph of variation of voltage in time Choose the correct answer What is the advantage...
-
You are expected to reflect on the learning you have achieved in subjects covered in your course. Briefly explain and contrast the way the following entities are taxed in relation to their profits...
-
Andrella David went for ice cream at the Tantallon, Nova Scotia, Sobeys store, and while waiting in line, a Sobeys staffer publicly accused her of being a known shoplifter. A human rights board of...
-
Navigate to Connect, watch the "Management Hits Rough Waters" video, and answer the questions provided. Which managerial challenges do you feel were the biggest obstacle(s) in the meeting portrayed...
-
What makes a good staff? After reviewing the lectures for this week, what are steps you can take to train and develop your staff to provide the best customer service possible? Would you include...
-
A baseball is hit almost straight up into the air with a speed of 32m/s. Estimate (a) how high it goes, (b) how long it is in the air. A falling stone takes 0.41 s to travel past a window 2.8 m tall....
-
You are thinking about purchasing 2,000 shares in the following firms: Firm Firm A Firm B Firm C Firm D Firm E Number of Shares 200 400 400 700 300 Firm's Beta 0.75 1.47 0.82 1.6 0.6 Expected Return...
-
Why did management adopt the new plan even though it provides a smaller expected number of exposures than the original plan recommended by the original linear programming model?
-
You simultaneously write a put and buy a call, both with strike prices of $80, naked, i.e., without any position in the underlying stock. What are the expiration date payoffs to this position for...
-
What are the three different types of Treasury STRIPS that are publicly traded?
-
What is a common weakness of Jensen's alpha and the Treynor ratio?
-
Explain the significance of the microscopic and macroscopic approaches to the study of thermodynamics.
-
Why is the thermodynamic process also called cyclic process? Explain with suitable example.
-
Define isothermal, isochoric and isobaric processes with suitable examples.
Study smarter with the SolutionInn App