1 Introduction in this assignment, you will implement uninformed search algorithms. 2 Multi-Agent Pac-Man In this...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1 Introduction in this assignment, you will implement uninformed search algorithms. 2 Multi-Agent Pac-Man In this assignment, we referred to Multi-Agent Pac-Man project(http://stanford.edu/-cpiech/cs221/ homework/prog/pacman/pacman.html) from Stanford University. We will use the file attached in KUMS Don't forget to use Python 3.6 when scripting your code. 3 Project Instruction 3.1 Breadth-first-search Breadth first search is an search algorithm that traverses tree like data structure exploring the neighbor nodes first. Sequence of exploring tree is explained in picture below. 6 8 10 11 12 Figure 1: Sequence of exploring tree with BFS Breadth-first-search can be implemented with a queue. By putting neighbor nodes of current mode into a queue and exploring next node with queue sequence, we can explore the neighbor nodes first. 3.2 Depth-first Search(DFS) 12 10 11 Figure 1: Sequence of exploring tree with DFS. Depth first search (DFS) is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each branch before backtracking. 3.3 What to do You should implement BFS and DFS algorithm in order to get Pac-man to the goal. Pac-man can move in four directions which are "North", "South', 'East', and 'West (Stop is not considered). Legal actions that Pac-man can take depends on Pac-man's situation. For example, if East and South side of Pac-man is blocked by will, legal-actions are "North' and 'west'. So, considering legal-action as a node, visit unexplored area in BFS and DFS order and reach to the goal. Figure 2: Example Tree of legal actions of Pac-man While exploring tree, please visit neighbor node in East, West, South, North order and print the sequence of x,y coordinate that Pac-man first visit in result bet file. Starting location of Pac-man is considered to be (0,0) 3.4 What to Submit Please submit searchAgents.py file only. Any late submissions will not be accepted. 3.5 How to Run the Code To try out the Pac-man, run pacman.py from the command line. This agent will just stop at every action If you implement search agent, the agent will move appropriately to search food. python pacman.py To activate the BFSAgent, use-p BFSAgent: python pacman.py -p BFSAgent To activate the DFSAgent, use-p DFSAgent: python pacman py-pDFSAgent 2 To run Pac-man with no graphic, use -q python pacman.py -p DFSAgent -q Note: If you use Macbook and the above codes do not work for you, try these ones: python3 pacman.py To activate the BFSAgent, use -p BFSAgent: python3 pacman.py -p BFSAgent To activate the DFSAgent, use -p DFSAgent: python3 pacman.py -p DFSAgent To run Pac-man with no graphic, use -q python3 pacman.py -p DFSAgent -q 1 Introduction in this assignment, you will implement uninformed search algorithms. 2 Multi-Agent Pac-Man In this assignment, we referred to Multi-Agent Pac-Man project(http://stanford.edu/-cpiech/cs221/ homework/prog/pacman/pacman.html) from Stanford University. We will use the file attached in KUMS Don't forget to use Python 3.6 when scripting your code. 3 Project Instruction 3.1 Breadth-first-search Breadth first search is an search algorithm that traverses tree like data structure exploring the neighbor nodes first. Sequence of exploring tree is explained in picture below. 6 8 10 11 12 Figure 1: Sequence of exploring tree with BFS Breadth-first-search can be implemented with a queue. By putting neighbor nodes of current mode into a queue and exploring next node with queue sequence, we can explore the neighbor nodes first. 3.2 Depth-first Search(DFS) 12 10 11 Figure 1: Sequence of exploring tree with DFS. Depth first search (DFS) is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each branch before backtracking. 3.3 What to do You should implement BFS and DFS algorithm in order to get Pac-man to the goal. Pac-man can move in four directions which are "North", "South', 'East', and 'West (Stop is not considered). Legal actions that Pac-man can take depends on Pac-man's situation. For example, if East and South side of Pac-man is blocked by will, legal-actions are "North' and 'west'. So, considering legal-action as a node, visit unexplored area in BFS and DFS order and reach to the goal. Figure 2: Example Tree of legal actions of Pac-man While exploring tree, please visit neighbor node in East, West, South, North order and print the sequence of x,y coordinate that Pac-man first visit in result bet file. Starting location of Pac-man is considered to be (0,0) 3.4 What to Submit Please submit searchAgents.py file only. Any late submissions will not be accepted. 3.5 How to Run the Code To try out the Pac-man, run pacman.py from the command line. This agent will just stop at every action If you implement search agent, the agent will move appropriately to search food. python pacman.py To activate the BFSAgent, use-p BFSAgent: python pacman.py -p BFSAgent To activate the DFSAgent, use-p DFSAgent: python pacman py-pDFSAgent 2 To run Pac-man with no graphic, use -q python pacman.py -p DFSAgent -q Note: If you use Macbook and the above codes do not work for you, try these ones: python3 pacman.py To activate the BFSAgent, use -p BFSAgent: python3 pacman.py -p BFSAgent To activate the DFSAgent, use -p DFSAgent: python3 pacman.py -p DFSAgent To run Pac-man with no graphic, use -q python3 pacman.py -p DFSAgent -q
Expert Answer:
Related Book For
Artificial Intelligence Structures And Strategies For Complex Problem Solving
ISBN: 9780321545893
6th Edition
Authors: George Luger
Posted Date:
Students also viewed these programming questions
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
Describe how to construct the function cpo ((D E), v) of two cpos (D, vD) and (E, vE). Prove that ((D E), v) is a cpo. (You may use facts about least upper bounds provided you state them clearly.)...
-
Solve the inequality. Write the solution in interval notation. 6 IV
-
Huang Inc., a private business following ASPE, has a contract with its president, Ms. Shen, to pay her a bonus during each of the years 2017, 2018, and 2019. Huang has the practice of paying Ms. Shen...
-
Silver Enterprises has acquired All Gold Mining in a merger transaction. Construct the balance sheet for the new corporation if the merger is treated as a purchase of interests for accounting...
-
What is the difference between hot, warm and cold sites?
-
Donahue Company uses both special journals and a general journal as described in this chapter. On June 30, after all monthly postings had been completed, the Accounts Receivable control account in...
-
Identify the following; MethodBodyReturn statementReturn typeParameter Look at this example we saw in our Methods lesson: public double findTheArea (double length, double w idth) { double area =...
-
How should William respond to Mr. Fanatic's call for "Show me the money!" In terms of limit options Production costs over time to increase profitability?
-
In your view, how important to your enduring success in the job are your early efforts in a new leadership role?
-
Using our Aggregate Demand/Aggregate supply model, describe how the following events would affect aggregate demand or aggregate supply, and in turn affect real output and the price level. Post...
-
Demonstrate the ability to identify, research and analyze an accounting issue Develop a persuasive argument supporting your position on the accounting issue Understand the complex nature of...
-
How does a changing environment can affect a business and how it relates to management accounting? Be practical, use examples to apply the concepts.
-
Illini, Inc. reported income from continuing operations before tax of $114 million, in addition to a loss on discontinued operations of $40 million. The company's tax rate is 25%. How should the...
-
Do you think the company should be alloweIn comparison; when one purchases a house, they pay the appraisal fee to the bank, and the bank selects the appraiser. Why should audits be different? Do you...
-
Draw a PPF for The Federated States of Econesia (FSE) which can produce 1,000 diamonds if it devotes all resources to diamond production or 4,000 automobiles if it devotes all resources to automobile...
-
A superior criticized a sales manager for selling high-revenue, low-profit items instead of lower-revenue but higher-profit items. The sales manager responded, My income is based on commissions that...
-
In a survey of 250 television viewers, 88 like to watch news, 98 like to watch sports, and 94 like to watch comedy. 33 people like to watch news and sports, 31 like to watch sports and comedy, and 35...
-
Consider the simple MYCIN-like rule: if A (B v C) D (.9) E (.75). Discuss the issues that arise in capturing these uncertainties in a Bayesian context. How might this rule be handled in...
-
Examples of analogical reasoning were presented in Section 7.3.2. Describe an appropriate representation and search strategy that would allow for identification of the best answer for this type...
-
According to the monetary approach to the balance of payments, what type of economic policies would help a country resolve a balance of trade deficit?
-
We discussed risk aversion as being descriptive of investor behavior. Can Do you think of any real-world behavior that you might consider to be evidence of the existence of risk preferrers?
-
Pick three developing countries and create a country risk index for them. Rank them ordinally in terms of factors that you can observe (exports, GDP growth, reserves, etc.) by looking at...
Study smarter with the SolutionInn App