Question: python code for a cleaning bot. there are 3 rooms. each room is A, B, C each room is either has laundry on the floor(dirty)

python code for a cleaning bot.
there are 3 rooms. each room is A, B, C
each room is either has laundry on the floor(dirty) or its clean. the two possible states are "Clean" or "Dirty"
The bot can do these three actions: "Right, "Left", "pick up" or "stop"
the bot will ask the user what room its in
and it will also ask the user if the room has laundry on the floor or not
////////////////////////////////////////////////////////
Enter room letter: A
does the room have laundry on the floor: True
////////////////////////////////////////////////////////
the bots action > "pick up" or clean it
this is printed on the screen. whatever choice the bot picks is printed on the screen
another example;
////////////////////////////////////////////////////////
Enter room letter: B
does the room have laundry on the floor: False
////////////////////////////////////////////////////////
since this means the room doesnt have dirty laundry on the floor it means that it is clean
so the action is "Move right" and then it goes to room C and repeats the process.
Keeping track/storing of the current precepts and previous ones too. an example is if we went to room A and it was clean and Room B which was dirty
Percepts would be:
A, Clean
B, Dirty
its possbible for a room to have multiple percepts in the same room. if we visit room A which was dirty and then room A again and its clean, the bot should consider this and always have an action and never stop, unless all 3 rooms are clean.
This is similar to the vacuum problem
python code for a cleaning bot. there are 3 rooms. each room
"suck" is the same as "pick up"

Percept sequence |A, Clean [A, Dirty (B, Clean [B, Dirty [A, Clean], (A, Clean (A, Clean], (A, Dirty Action Right Suck Left Suck Right Suck

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!