{"id":24186064,"url":"https://github.com/carlosagalicia/sheep-shepherd-simulation","last_synced_at":"2026-05-08T22:32:22.161Z","repository":{"id":270042050,"uuid":"909162311","full_name":"carlosagalicia/Sheep-Shepherd-Simulation","owner":"carlosagalicia","description":"This project implements a multi-agent simulation using the Mesa framework to model the behavior of shepherd agents interacting with sheeps and the environment.","archived":false,"fork":false,"pushed_at":"2024-12-28T01:01:57.000Z","size":5456,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T01:41:38.121Z","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-27T22:33:46.000Z","updated_at":"2024-12-28T03:35:30.000Z","dependencies_parsed_at":"2024-12-28T00:17:03.333Z","dependency_job_id":"44560cb0-8f57-444a-9493-127258b49b2e","html_url":"https://github.com/carlosagalicia/Sheep-Shepherd-Simulation","commit_stats":null,"previous_names":["carlosagalicia/sheep-shepherd-simulation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/carlosagalicia/Sheep-Shepherd-Simulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2FSheep-Shepherd-Simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2FSheep-Shepherd-Simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2FSheep-Shepherd-Simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2FSheep-Shepherd-Simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlosagalicia","download_url":"https://codeload.github.com/carlosagalicia/Sheep-Shepherd-Simulation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2FSheep-Shepherd-Simulation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32800083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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:44.352Z","updated_at":"2026-05-08T22:32:22.142Z","avatar_url":"https://github.com/carlosagalicia.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sheep-Shepherd-Simulation\n\nThis project implements a multi-agent simulation using the Mesa framework to model the behavior of shepherd agents interacting with sheeps and the environment. The simulation includes collecting and moving sheep within a grid environment.\n\n## Overview\n\n- **Functionality:** The simulation models shepherd agents that move within a grid to collect sheep and deposit them in specified locations. The environment uses a grid representation to track the positions of agents and sheep in real time.\n- **Objective:** To study agent-based modeling techniques and understand decision-making and resource management within a simulated environment.\n\n## Key Learning Areas\n### 1. Agent-Based Modeling\n\n- **Agent Behavior:** Implementation of autonomous agents with unique behaviors, such as moving randomly or based on environmental conditions.\n- **Environment Interaction:** Agents interact with a grid environment, collecting and depositing sheep based on specific rules.\n\n### 2. Mesa Framework\n\n- **SingleGrid:** Used to represent the environment where agents interact, ensuring only one agent per cell.\n- **RandomActivation:** Implements simultaneous activation of all agents in each simulation step.\n- **Data Collection:** Utilizes Mesa’s DataCollector to track simulation progress and gather metrics.\n\n### 3. Real-Time Visualization\n\n- **Matplotlib Integration:** Visualizes agent movements and environment changes with animations using Matplotlib.\n- **Interactive Visualization:** Enables analysis of simulation dynamics through graphical representations.\n\n## Languages and Tools Used\n\n### Python\n\n- **Mesa:** Framework for agent-based modeling.\n- **Matplotlib:** For creating animations and visualizing the simulation.\n- **NumPy \u0026 Pandas:** For numerical operations and data analysis.\n\n## Installation and Usage\n\n### Requirements\n- **Python 3.x** to run the script.\n- **Required Libraries:**\n```bash\npip install mesa matplotlib numpy pandas\n```\n\n## Instructions\n1. Clone the repository\n  ```bash\n  git clone https://github.com/carlosagalicia/Sheep-Shepherd-Simulation.git\n  ```\n\n2. Navigate to the project directory and run the notebook:\n  ```bash\n  jupyter notebook sheep-shepherd.ipynb\n  ```\n\n3. Follow the instructions in the notebook to execute the simulation.\n\n## Operation\n\n- The shepherd agents move within the grid, collecting sheep from one location and depositing them in another.\n- Agents make decisions based on their surroundings, including whether to move, pick up, or drop off sheep.\n- The simulation updates the grid environment in real time and visualizes the process.\n\n## Usage\n\n- Adjust simulation parameters in the notebook to explore different scenarios.\n- Run all cells in the notebook to start the simulation.\n\n## Visual Representation\n\u003ctable\u003e\n\u003ctr\u003e\n  \u003ctd width=\"50%\"\u003e\n    \u003ch3 align=\"center\"\u003eUngrouped Sheep (initial state)\u003c/h3\u003e\n    \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/58d51067-4112-4252-b9f9-623decd62690\"\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\"\u003eGrouped Sheep (final state)\u003c/h3\u003e\n    \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/c39ba0b0-6c1a-471a-9147-f24fa0ecb051\"\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%2Fsheep-shepherd-simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlosagalicia%2Fsheep-shepherd-simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosagalicia%2Fsheep-shepherd-simulation/lists"}