Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Assignment Details 1.1 Coursework Objectives The coursework will be used to assess your abilities to apply the technologies you have studied to solving problems.

image text in transcribed
image text in transcribed
image text in transcribed
1 Assignment Details 1.1 Coursework Objectives The coursework will be used to assess your abilities to apply the technologies you have studied to solving problems. You are given a problem to solve, and will be tested on your solutions, alongside your understanding of, and the appropriateness of the techniques utilised. This assignment will led the achievement of the following learning outcomes, i.c. ability to: - Formulate appropriate representations of problems and associated knowledge - Use criteria to discriminate, select and apply appropriate paradigms - Design and implement a range of different search methods 1.2 Introduction - The Cleaning Robot Roomba is a vacuum cleaning robot. The robot operates by mapping the floor using a LiD.AR and producing a digital representation of the floor. Suppose the robot identified 12 nodes in the floor, as shown in Figure 1. To clean the floor, Roomba has to visit all nodes at least once. Since Roomba operates via batieries, each translation from one node to an adjacent node drains the battery by 1 Watthours (Wh). Fottunately, Roomba has 12Wh of battery energy available onboard. Roomba has to navigate to the charging station (node 12) when battery encrgy drops to 50% (i.e. 6 Wh). and then resume cleaning. 2.1 Assignment Questions For the case study presented above, answer the following questions by providing a Python program. The code in each question builds upon the next one. 1) Convert the graph shown in Figure 1 into proper computer-friendly representation. 2) The robot should store its state in a variable called "state". Implement a finite-state machine (FSM) to change state from "Cleaning" to "Charging" when battery level drogs to 6Wh. The program should accept an input Bat terylevel and output the state as string. \begin{tabular}{|l|} \hline Sample output \\ Enter battery level: 5 \\ Robot state: Charging \\ \hline \end{tabular} 3) Implement a Depth-First search strategy to produce a plan to clean the floor for the fobot by visiting all nodes at least once. The algonthm should work for any starting node. Your output shoold be a sequence of translations as the following: \begin{tabular}{l} \hline Sample output \\ Enter starting node: 1 \\ 12346B64579101211 \\ \hline \end{tabular} 4) Encode the FSM with the search strategy. The robot should execute the strategy in Question 3 when in "Cleaning" state, and another strategy to navigate to the charging station when in "Charging" state. Assume that vising node 12 will increase bantery level to 12 Wh instantly. Also assume the robot starts with fully-charged battery. The output of the code should be a sequence of translations as described in Question 3 includiag the state and battery level of the robot. You should allow the user to input the starting node number. \begin{tabular}{|l|} \hline Sanple output \\ Enter starting node: 1 \\ 1 (Cleaning, 12 Wh) > \\ 2 (Cleaning, 11 Wh) > \\ 3 (Cleaning, 10 Wh) > \\ 4 (Cleaning, 9 Wh) > \\ 6 (Cleaning, 8 Wh) > \\ 8 (Cleaning, 7 Wh) > \\ 6 (Charging, 6 Wh) > \\ 11 (Charging, 5 Wh) > \\ 12 (Cleaning, 12 Wh) > \\ 10 (Cleaning, 11 Wh) > \\ 9 (Cleaning, 10 Wh) > \\ 7 (Cleaning, 9 Wh) > \\ 5 (Cleaning, 8 Wh) \\ \hline \end{tabular} 5) Unfortunately, in a practical scenario, the robot does not always start fully charged. Modify your code by implementing a third state "Error" when no feasible plan is possible that will make the robot reach the charging station without completely draining the battery. In "Error" state, the robot aborts any search strategy. The output of the code should be a sequence of translations as described in Question 4 including the state of the robot. You should allow the user to input the starting node number, and the initial battery level. \begin{tabular}{l} \hline Sample output \\ Enter starting node: 8 \\ Enter starting battery level in Wh: 3 \\ 8 (Charging, 3 Wh) \\ 6 (Charging, 2 Wh) \\ 4 (Charging, 1 Wh) \\ 11 (Error, OWh) \\ \hline \end{tabular} Note: the sample output results were provided for illustration purpose only. The actual output of your program may be different depending on your graph representation. Hence, don't rely on the sample output as a test cases to check your program correctness

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

Recommended Textbook for

Advances In Databases 11th British National Conference On Databases Bncod 11 Keele Uk July 7 9 1993 Proceedings Lncs 696

Authors: Michael F. Worboys ,Anna F. Grundy

1993rd Edition

3540569219, 978-3540569213

More Books

Students also viewed these Databases questions

Question

4. Are there any disadvantages?

Answered: 1 week ago

Question

3. What are the main benefits of using more information technology?

Answered: 1 week ago

Question

start to review and develop your employability skills

Answered: 1 week ago