Structural Overview

Below is a UML class diagram of the basic structure of Orego.

The main object is an instance of edu.lclark.orego.ui.Orego. This contains an instance of edu.lclark.orego.mcts.Player, which in turn contains:

  • an edu.lclark.orego.core.Board, which keeps track of the board state,

  • an edu.lclark.orego.book.OpeningBook, which generates opening book moves,

  • one or more edu.lclark.orego.mcts.McRunnables, which performs Monte Carlo simulations,

  • an edu.lclark.orego.mcts.TreeDescender and an edu.lclark.orego.mcts.TreeUpdater, which work with the Monte Carlo search "tree" stored in an edu.lclark.orego.mcts.TranspositionTable, and

  • an edu.lclark.orego.time.TimeManager, which lets the program decide how to use its allotted time.

How It Works:

The instance of Orego accepts GTP commands from a user or other program. Each command is passed to the handleCommand method, which tokenizes the command and calls the proper methods based on user input.

A typical GTP command is genmove black, requesting a move. On receiving this command, handleCommand calls the bestMove method from the Player. This starts a series of threads wrapped around the McRunnables, each of which repeatedly calls its own performMcRun method. This method:

    1. copies the state from the Player's Board to its own Board,

    2. has the Player's TreeDescender generate moves to the frontier of the tree,

    3. completes the run by calling the McRunnable's own playout method, and

    4. has the Player's TreeUpdater update the state of the tree.

Once the allotted time for the move has run out, the Player stops the threads and returns the move from the root of the tree with the most wins.