{"id":40211485,"url":"https://github.com/michaelflppv/bohnenspiel","last_synced_at":"2026-01-19T21:30:37.198Z","repository":{"id":330537183,"uuid":"866691456","full_name":"michaelflppv/bohnenspiel","owner":"michaelflppv","description":"This is a repository of the educational project within CS405 Artificial Intelligence course at the University of Mannheim","archived":false,"fork":false,"pushed_at":"2024-10-13T19:21:00.000Z","size":97,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-27T18:03:15.598Z","etag":null,"topics":["artificial-intelligence","games","machine-learning","mcts-algorithm","monte-carlo-tree-search","python","reinforcement-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","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/michaelflppv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-02T17:50:27.000Z","updated_at":"2025-07-09T19:13:23.000Z","dependencies_parsed_at":"2025-12-27T18:03:26.468Z","dependency_job_id":null,"html_url":"https://github.com/michaelflppv/bohnenspiel","commit_stats":null,"previous_names":["michaelflppv/bohnenspiel"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/michaelflppv/bohnenspiel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelflppv%2Fbohnenspiel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelflppv%2Fbohnenspiel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelflppv%2Fbohnenspiel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelflppv%2Fbohnenspiel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelflppv","download_url":"https://codeload.github.com/michaelflppv/bohnenspiel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelflppv%2Fbohnenspiel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28585481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"last_error":"SSL_read: 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":["artificial-intelligence","games","machine-learning","mcts-algorithm","monte-carlo-tree-search","python","reinforcement-learning"],"created_at":"2026-01-19T21:30:36.266Z","updated_at":"2026-01-19T21:30:37.192Z","avatar_url":"https://github.com/michaelflppv.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# State AI - Java Implementation\n\n## Overview\n\nThis project involves implementing an AI to play the game **State** using a Monte-Carlo Tree Search (MCTS) algorithm. The AI must compete against a reference AI, which employs a Min-Max algorithm with a depth of 4. The goal is to create a smarter AI that can outperform the reference AI consistently, making decisions within a 3-second timeframe for each move.\n\n## Game Rules - Specific Variant\n\nIn this variant of the State:\n\n1. **Capture Conditions**: \n   - A player captures beans if the last bean lands in a field with **2, 4, or 6 beans**. \n   - The player also captures beans from the previous field if it has **2, 4, or 6 beans**.\n   - This process continues until a field doesn't meet the capture condition.\n   \n2. **Distribution of Beans**: \n   - Each player has 6 fields on their side.\n   - On a player's turn, they pick a field, and beans from that field are distributed counter-clockwise across subsequent fields.\n   - Beans are **not placed** in the large pits at the ends of the board, which only serve to store captured beans.\n\n## AI Implementation\n\n### Key Criteria\n\n1. **AI Capability**:\n   - The AI must beat a reference Min-Max AI, with its search depth limited to 4.\n   - The AI should be able to make decisions within 3 seconds per turn.\n   - An MCTS-based implementation with Light Playouts should outperform the reference AI significantly.\n\n2. **Evaluation Against Reference AI**:\n   - The AI’s strength will be measured against the reference AI in scheduled periods, as announced by the course leader.\n   - The AI must demonstrate strong performance and consistently make decisions within the given time limit.\n\n### Implementation Details\n\n#### REST API Integration\n\nThe AI must use the REST interface provided at [State API Documentation](http://bohnenspiel.informatik.uni-mannheim.de/). This interface allows the AI to play against the reference AI and other players.\n\n- **Java Integration**:\n  - A basic random AI is available in the [Main.java](http://bohnenspiel.informatik.uni-mannheim.de/doc/index) class. This class can be used to connect the custom AI to the game interface.\n\n- **Python Integration**:\n  - For those implementing in Python, it is recommended to create a counterpart to `Main.java`. Python offers many libraries to interface with REST APIs, such as those described in [Real Python’s API Integration Guide](https://realpython.com/api-integration-in-python/).\n\n### AI Strategy\n\nThe AI will use a **Monte-Carlo Tree Search (MCTS)** algorithm to decide moves. Key aspects include:\n\n1. **Tree Search Algorithm**: \n   - The AI will simulate potential moves, evaluating future game states by performing playouts (random simulations) from each possible move.\n\n2. **Light Playouts**: \n   - To improve efficiency, \"light\" playouts will be used. These playouts use simple heuristic-based simulations rather than detailed look-ahead logic to save computation time.\n\n3. **Heuristic Evaluation**: \n   - The AI will use a heuristic function to evaluate game states. This will include factors such as:\n     - The number of beans captured.\n     - Potential to set up further captures on subsequent turns.\n     - Blocking the opponent’s ability to capture beans.\n\n4. **Search Depth**: \n   - While the reference AI is limited to a depth of 4, the MCTS implementation can effectively evaluate much deeper strategies through playouts, thus outperforming the reference AI.\n   \n### Performance and Decision Time\n\n- **Time Constraints**: The AI must make decisions within 3 seconds per move.\n- **Depth of Analysis**: Even though the reference AI has a maximum depth of 4, the MCTS algorithm can simulate thousands of potential game states within the allowed time, leading to stronger decision-making.\n\n## How to Run the AI\n\n### Java Implementation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/your-repo/bohnenspiel-ai\n   cd bohnenspiel-ai\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelflppv%2Fbohnenspiel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelflppv%2Fbohnenspiel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelflppv%2Fbohnenspiel/lists"}