GithubHelp home page GithubHelp logo

colleyli / mamcts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juloberno/mamcts

0.0 1.0 0.0 749 KB

Multi-agent Monte Carlo Tree Search implementation in C++

License: MIT License

Python 7.01% C++ 90.22% Shell 0.16% Starlark 2.61%

mamcts's Introduction

Multi-Agent MCTS

Multi-agent Monte Carlo Tree Search implementation in C++.

Approach

  • Classical Monte Carlo Tree Search extended to the Multi-Agent MDP problem
  • Selection Step:
    • Agents choose actions simultaneusly at each stage (Stage node class contains intermediate nodes for each agent)
    • Action selection based on node statistic class ( UCTStatistic provided). An "Ego"-agent can have a different statistic class than the other agents
    • The JoinAction determines next selected stage
  • Expansion Step. node or, for a leaf node, the newly expanded node via execution of the joint action in the environment.
  • Then, a random rollout policy is applied to the newly expanded state selecting joint actions randomly until reaching a terminal state (class random heuristic)
  • Statistic updates of each agent separately via backpropagation

Features

  • Recursively tested consistency of UCT tree
  • Interfaces to allow easy extension with other statistics, environments, heuristics.
  • Export of trees to graphviz dotfiles.
  • Static polymorphic interfaces to avoid dynamic polymorphism runtime overhead (However, the effect may be subtle and was not evaluated yet)

Installation & Test

  • Install bazel
  • Run bazel test //... in the WORKSPACE directory
  • Under "WORKSPACE directory"/bazel-genfiles/test you find the dot file "test_tree.gy"
  • Use dot test_tree.gv -O -Tsvg to render a svg-file

Example

SimpleState is a 1D chain environment with two agents. The agents move towards the goal state if they select different actions. They remain at the current state if they select the same action.

20 iterations yield the following search tree with SimpleState. Stage nodes are enclosed within dotted boxes and contain the statistic informations for each agent in circles. Edges correspond to an action of one agent with action-value V and visit count N indicated.

Search tree example

Citation

If you use this code please cite it as:

@misc{bernhard_mamcts_2020,
  title = {{MA-MCTS}: A configurable library for Multi-Agent Monte Carlo Tree Search in C++},
  author = "{Julian Bernhard}",
  howpublished = {\url{https://github.com/juloberno/mamcts}},
  url = "https://github.com/juloberno/mamcts",
  year = 2019,
  note = "[Online; accessed 25-June-2019]"
}

mamcts's People

Contributors

juloberno avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.