{"id":24186085,"url":"https://github.com/carlosagalicia/cleaning-simulation","last_synced_at":"2026-05-15T05:03:41.042Z","repository":{"id":270157622,"uuid":"909494506","full_name":"carlosagalicia/Cleaning-Simulation","owner":"carlosagalicia","description":"Simulation of a group of vacuum cleaning agents tasked with cleaning a grid-based room.","archived":false,"fork":false,"pushed_at":"2024-12-28T21:56:18.000Z","size":223,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T01:41:40.548Z","etag":null,"topics":["agent-based-modeling","matplotlib","mesa","python","simulation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carlosagalicia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-28T21:47:01.000Z","updated_at":"2024-12-28T21:59:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"71980403-afbe-4e9f-9962-193ecbdcd74b","html_url":"https://github.com/carlosagalicia/Cleaning-Simulation","commit_stats":null,"previous_names":["carlosagalicia/cleaning-simulation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/carlosagalicia/Cleaning-Simulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2FCleaning-Simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2FCleaning-Simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2FCleaning-Simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2FCleaning-Simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlosagalicia","download_url":"https://codeload.github.com/carlosagalicia/Cleaning-Simulation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2FCleaning-Simulation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33054454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-based-modeling","matplotlib","mesa","python","simulation"],"created_at":"2025-01-13T12:33:49.729Z","updated_at":"2026-05-15T05:03:41.027Z","avatar_url":"https://github.com/carlosagalicia.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cleaning Robots Simulation\n\nThis project simulates a group of vacuum cleaning agents tasked with cleaning a grid-based room. The room starts with a defined percentage of dirty cells (dirt agents), and the vacuum cleaners navigate the space, cleaning these cells while avoiding collisions with other agents.\n\n## Overview\n\n- **Functionality:** Simulates a room with dirt agents and vacuum cleaning agents. The vacuums clean the room by detecting and moving to dirty cells.\n- **Objective:** Test the cleaning efficiency of vacuum agents by measuring the time and steps needed to clean a predefined percentage of dirty cells.\n\n## Key Features\n\n### 1. Agents and Environment\n- **Vacuum Cleaner Agents:** Agents move within the room, clean dirty cells, and measure their efficiency based on cleaned and visited cells.\n- **Dirt Agents:** Represent dirty cells that the vacuum agents aim to clean.\n- **Room Model:** A grid environment where agents operate, represented using Mesa's `SingleGrid`.\n\n### 2. Simulation Process\n- **Random Activation:** All agents act in random order within each step.\n- **Data Collection:** Tracks the grid's state and performance metrics such as cleaning efficiency and steps required.\n- **Visualization:** Displays animations of the cleaning process and collects statistical data for analysis.\n\n### 3. Customization\n- Parameters such as room dimensions, the percentage of dirty cells, and the number of vacuum agents can be adjusted to explore different scenarios.\n\n## Languages and Tools Used\n\n### Python\n- **Mesa:** For agent-based modeling and simulation.\n- **Matplotlib:** For data visualization and animations.\n- **Seaborn:** To enhance the visual appeal of graphs.\n- **NumPy and Pandas:** For numerical computations and data handling.\n\n## Installation and Usage\n\n### Requirements\n- Python 3.x\n- Required libraries:\n  ```bash\n  pip install mesa==2.3.3 matplotlib seaborn numpy pandas\n  ```\n\n### Instructions\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/carlosagalicia/Cleaning-Simulation.git\n   ```\n\n2. Navigate to the project directory and run the script:\n   ```bash\n   jupyter notebook cleaning_vacuums_simulation.ipynb\n   ```\n\n3. The program will execute the cleaning simulation and display the results, including animation and performance metrics.\n\n## Visualization and Results\n- The grid is visualized using Matplotlib to track the progress of cleaning over time.\n- An animation of the cleaning process is created to observe agent behavior step by step.\n\n## Example Output\n- **Simulation Metrics:**\n  - Total steps: `X` (varies based on parameters)\n  - Efficiency per vacuum cleaner: Displayed in the terminal.\n- **Visualization:**\n  - Animated cleaning process of the grid.\n\n## Customization Options\n- Modify these parameters in the script to test different scenarios:\n  - Room dimensions (`WIDTH`, `HEIGHT`)\n  - Percentage of initial dirt (`DIRTY_CELLS`)\n  - Number of vacuum agents (`VACUUMS`)\n\n## Key Learning Areas\n\n### 1. Agent-Based Modeling\n- Designing agents with unique behaviors (Vacuum Cleaners and Dirt).\n- Implementing interactions between agents and their environment.\n\n### 2. Performance Evaluation\n- Measuring and analyzing cleaning efficiency.\n- Visualizing the agent-based simulation process.\n\n### 3. Data Collection and Analysis\n- Utilizing Mesa's `DataCollector` to record metrics at each simulation step.\n\n## Visual Representation\n\n### Cleaning Progress Animation\n- The grid is animated to display the cleaning process, showing vacuums moving and cleaning dirt in real time.\n\n## Visual Representation\n\u003ctable\u003e\n\u003ctr\u003e\n  \u003ctd width=\"50%\"\u003e\n    \u003ch3 align=\"center\"\u003eDirty room with robots (initial state)\u003c/h3\u003e\n    \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/5391c299-0766-478d-9901-ded99ac27f6d\"\u003e\n    \u003c/div\u003e\n  \u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003ctable\u003e\n\u003ctr\u003e\n  \u003ctd width=\"50%\"\u003e\n    \u003ch3 align=\"center\"\u003eCleaned room (final state)\u003c/h3\u003e\n    \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/54177fdd-078a-455e-846d-bd4000bff325\"\u003e\n    \u003c/div\u003e\n  \u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosagalicia%2Fcleaning-simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlosagalicia%2Fcleaning-simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosagalicia%2Fcleaning-simulation/lists"}