예제 #1
0
 def __init__(self):
     # Populated with defaults to begin with.
     self._features = {
         "ping": 0,  # TODO: Remove dependency of the xboard module on ping
         "setboard": 0,
         "playother": 0,
         "san": 0,
         "usermove": 0,
         "time": 1,
         "draw": 1,
         "sigint": 1,
         "sigterm": 1,
         "reuse": 1,
         "analyze": 1,
         "myname": None,
         "variants": None,
         "colors": 1,
         "ics": 0,
         "name": None,
         "pause": 0,
         "nps": 1,
         "debug": 0,
         "memory": 0,
         "smp": 0,
         "egt": [],
         "option": OptionMap(),
         "done": None
     }
예제 #2
0
    def __init__(self, *, Executor=concurrent.futures.ThreadPoolExecutor):
        self.idle = True
        self.pondering = False
        self.state_changed = threading.Condition()
        self.semaphore = threading.Semaphore()
        self.search_started = threading.Event()

        self.board = chess.Board()
        self.uci_chess960 = None
        self.uci_variant = None

        self.name = None
        self.author = None
        self.options = OptionMap()
        self.uciok = threading.Event()
        self.uciok_received = threading.Condition()

        self.readyok_received = threading.Condition()

        self.bestmove = None
        self.ponder = None
        self.bestmove_received = threading.Event()

        self.return_code = None
        self.terminated = threading.Event()

        self.info_handlers = []

        self.pool = Executor(max_workers=3)
        self.process = None