Question: C++ Simple Vacuum Cleaner (Simple Reflex Agent) Problem: Hi, I am trying to create a simple vacuum cleaner in C++. This cleaner will scan a
C++ Simple Vacuum Cleaner (Simple Reflex Agent)
Problem: Hi, I am trying to create a simple vacuum cleaner in C++. This cleaner will scan a number of rooms, determine whether each room is dirty or not, clean it if is and move on to the next room, do nothing if it is already clean and move on to the next room. The program will terminate when the vacuum cleaner returns to its original room. So if there were only two rooms, it would start at room A, clean it and move on to room B, clean that (or leave it alone) and go back to A and then terminate.
Design: What I have so far is 3 separate classes (enviornment, room, and vacuum cleaner). The enviornment is a 10x10 grid implemented as a double array. This 2d array contains room objects in each space. That room object holds a bool value of isDirty(). The agent class has 4 functions (moveLeft, moveRight, clean, sense). Sense() will determine whether or not the room is dirty (false or true), clean() will turn isdirty() from true into false, moveLeft and moveRight will move around the grid.
Code: Here is the layout I made. I'm pretty sure it has major issues, and feel free to let me know what I can change. I just want to know if I have it set up correctly. I also have no idea where to start on how to make it all come together. Any help is appreciated!
Environment.h

Enviornment.cpp

Room.h

Room.cpp

VacuumAgent.h

VacuumAgent.cpp


Main

Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
