{"id":17910765,"url":"https://github.com/jbradberry/mcts","last_synced_at":"2025-07-28T08:36:29.349Z","repository":{"id":141771324,"uuid":"45577934","full_name":"jbradberry/mcts","owner":"jbradberry","description":"Board game AI implementations using Monte Carlo Tree Search","archived":false,"fork":false,"pushed_at":"2020-04-19T23:24:46.000Z","size":27,"stargazers_count":183,"open_issues_count":1,"forks_count":34,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-18T23:44:24.150Z","etag":null,"topics":["artificial-intelligence","board-game","board-game-framework","monte-carlo-tree-search","python"],"latest_commit_sha":null,"homepage":null,"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/jbradberry.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2015-11-05T01:02:46.000Z","updated_at":"2024-12-06T01:32:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ceacdc5-5f79-45b7-aa63-c6bf8f842cac","html_url":"https://github.com/jbradberry/mcts","commit_stats":{"total_commits":33,"total_committers":1,"mean_commits":33.0,"dds":0.0,"last_synced_commit":"2480de920fca47d5b2d7f62916f771d59679c24f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbradberry%2Fmcts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbradberry%2Fmcts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbradberry%2Fmcts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbradberry%2Fmcts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbradberry","download_url":"https://codeload.github.com/jbradberry/mcts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245179426,"owners_count":20573461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","board-game","board-game-framework","monte-carlo-tree-search","python"],"created_at":"2024-10-28T19:34:27.322Z","updated_at":"2025-03-23T22:33:06.385Z","avatar_url":"https://github.com/jbradberry.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Monte Carlo Tree Search\n=======================\n\nThis is an implementation of an AI in Python using the UCT Monte Carlo\nTree Search algorithm.\n\nThe Monte Carlo Tree Search AIs included here are designed to work\nwith `jbradberry/boardgame-socketserver\n\u003chttps://github.com/jbradberry/boardgame-socketserver\u003e`_ and\n`jbradberry/boardgame-socketplayer\n\u003chttps://github.com/jbradberry/boardgame-socketplayer\u003e`_.\n\n\nRequirements\n------------\n\n* Python 2.7, 3.5+; PyPy; PyPy3\n* six\n\n\nGetting Started\n---------------\n\nTo set up your local environment you should create a virtualenv and\ninstall everything into it. ::\n\n    $ mkvirtualenv mcts\n\nPip install this repo, either from a local copy, ::\n\n    $ pip install -e mcts\n\nor from github, ::\n\n    $ pip install git+https://github.com/jbradberry/mcts#egg=mcts\n\nAdditionally, you will need to have `jbradberry/boardgame-socketplayer\n\u003chttps://github.com/jbradberry/boardgame-socketplayer\u003e`_ installed in\norder to make use of the players.\n\nThis project currently comes with two different Monte Carlo Tree\nSearch players.  The first, ``jrb.mcts.uct``, uses the count of the\nnumber of wins for a node to make its decisions.  The second,\n``jrb.mcts.uctv`` instead keeps track of the evaluated value of the\nboard for the playouts from a given node ::\n\n    $ board-play.py t3 jrb.mcts.uct    # number of wins metric\n    $ board-play.py t3 jrb.mcts.uctv   # point value of the board metric\n\nThese AI players can also take additional arguments:\n\ntime (default: 30)\n  The amount of thinking time allowed for the AI to make its decision,\n  in seconds.  Ex: ``$ board-play.py t3 jrb.mcts.uct -e time=5``\n\nmax_actions (default: 1000)\n  The maximum number of actions, or plays, to allow in one of the\n  simulated playouts before giving up.  Ex: ``$ board-play.py t3\n  jrb.mcts.uct -e max_actions=500``\n\nC (default: 1.4)\n  The exploration vs. exploitation coefficient at the heart of the UCT\n  algorithm.  Larger values prioritize exploring inadequately covered\n  actions from a node, smaller values prioritize exploiting known\n  higher valued actions.  Experimentation with this variable to find\n  reasonable values for a given game is recommended.  Ex: ``$\n  board-play.py t3 jrb.mcts.uct -e C=3.5``\n\nThe ``-e`` flag may be used multiple times to set additional\nvariables.\n\n\nGames\n-----\n\nCompatible games that have been implemented include:\n\n* `Reversi \u003chttps://github.com/jbradberry/reversi\u003e`_\n* `Connect Four \u003chttps://github.com/jbradberry/connect-four\u003e`_\n* `Ultimate (or 9x9) Tic Tac Toe\n  \u003chttps://github.com/jbradberry/ultimate_tictactoe\u003e`_\n* `Chong \u003chttps://github.com/jbradberry/chong\u003e`_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbradberry%2Fmcts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbradberry%2Fmcts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbradberry%2Fmcts/lists"}