Using deapth-first strategy, write a python code for a roomba machine to display when it is on the charging state and when it is on the cleaning state when passing through each node of these  noted that when its level of charge become less than 6 it converts from the cleaning to the charging states and its cleaning station is on the 12th node .

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Using deapth-first strategy, write a python code for a roomba machine to display when it is on the charging state and when it is on the cleaning state when passing through each node of these  noted that when its level of charge become less than 6 it converts from the cleaning to the charging states and its cleaning station is on the 12th node . 

#Sample 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)
Transcribed Image Text:#Sample 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)
1.2 Introduction - The Cleaning Robot
Roomba is a vacuum cleaning robot. The robot operates by mapping the floor using a LIDAR 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 batteries, each translation from one node to an adjacent node drains the battery by 1 Watt-
hours (Wh). Fortunately, Roomba has 12 Wh of battery energy available onboard. Roomba has to
navigate to the charging station (node 12) when battery energy drops to 50% (i.e. 6 Wh), and then
resume cleaning.
Start
Charging
station
Figure 1 - Map produced by the Roomba
(HW)
Transcribed Image Text:1.2 Introduction - The Cleaning Robot Roomba is a vacuum cleaning robot. The robot operates by mapping the floor using a LIDAR 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 batteries, each translation from one node to an adjacent node drains the battery by 1 Watt- hours (Wh). Fortunately, Roomba has 12 Wh of battery energy available onboard. Roomba has to navigate to the charging station (node 12) when battery energy drops to 50% (i.e. 6 Wh), and then resume cleaning. Start Charging station Figure 1 - Map produced by the Roomba (HW)
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY