Vacuum Cleaner | Simple Reflexive AI Agent

dilli_hangrae
2 min readFeb 3, 2024

--

Dilli Hang Rai demonstrating a Cool Stereo AI Bot— Cleaning

A reflex agent is a type of artificial intelligence (AI) agent that makes decisions based solely on the current state of the environment, without considering the history of past states. It reacts to sensory input using predefined rules or conditions. A vacuum cleaner can be considered a simple reflex agent, especially if it operates based on basic sensor input and a set of predefined rules.

Here’s how a simple reflex agent model might work for a vacuum cleaner:

Percept:

  • The vacuum cleaner’s sensors detect the current state of the environment, which includes information about whether a particular location is dirty or clean.

Action:

If the current location is dirty, the vacuum cleaner performs the “suck” action to clean the area. If the current location is clean, the vacuum cleaner moves to the next location.

Rule:

  • “If the current location is dirty, then suck.” “If the current location is clean, then move to the next location.” This simple reflex agent operates based on a direct mapping between percept and action.
  • It doesn’t have memory or the ability to learn from past experiences. Its decision-making is determined solely by the immediate state of the environment.
  • While this basic model may work for scenarios with a limited and predictable environment (e.g., a small room with known dirt locations), more sophisticated AI techniques, such as model-based or learning-based approaches, might be necessary for complex environments where the state is dynamic and uncertain. Additional variables and parameters are required for larger and more complex scenarios.

Case:

Room A and Room B are Dirty, and initially, an agent is inside Room A. There are 2 rooms so we would have 4 cases of dirt and clean and 8 possible states for an agent.

A vacuum cleaner as a simple reflexive AI intelligent agent

Scenario and States:

Showing the various states of a vacuum cleaner

Source Code: (You need to install an additional library)

https://colab.research.google.com/drive/1r71z0uhHvs0dnRBSiHOMsLFOroxk_ATr?usp=sharing

Godawari-College/4thSemester/AI/Projects/vaccum_cleaner.py at main · Dilli822/Godawari-College · GitHub

YouTube:

References:

Textbook: Stuart Russel and Peter Norvig, Artificial Intelligence A Modern Approach, Pearson

--

--

dilli_hangrae

Deeply in love with Nature 🍀, Computer Science 🧑‍💻 and Music. From Nepal 🇳🇵. Research, Software Development & AI ✨ . Find me at https://dilli822.github.io