当前位置: 首页>>代码示例>>Python>>正文


Python gtp.RESIGN属性代码示例

本文整理汇总了Python中gtp.RESIGN属性的典型用法代码示例。如果您正苦于以下问题:Python gtp.RESIGN属性的具体用法?Python gtp.RESIGN怎么用?Python gtp.RESIGN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在gtp的用法示例。


在下文中一共展示了gtp.RESIGN属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: from_pygtp

# 需要导入模块: import gtp [as 别名]
# 或者: from gtp import RESIGN [as 别名]
def from_pygtp(pygtpc):
    """Converts from a pygtp coordinate to a MiniGo coordinate."""
    # GTP has a notion of both a Pass and a Resign, both of which are mapped to
    # None, so the conversion is not precisely bijective.
    if pygtpc in (gtp.PASS, gtp.RESIGN):
        return None
    return go.N - pygtpc[1], pygtpc[0] - 1 
开发者ID:mlperf,项目名称:training_results_v0.5,代码行数:9,代码来源:coords.py

示例2: get_move

# 需要导入模块: import gtp [as 别名]
# 或者: from gtp import RESIGN [as 别名]
def get_move(self, color):
        self.accomodate_out_of_turn(color)
        move = self.suggest_move(self.position)
        if self.should_resign():
            return gtp.RESIGN
        return coords.to_pygtp(move) 
开发者ID:mlperf,项目名称:training_results_v0.5,代码行数:8,代码来源:gtp_wrapper.py

示例3: parse_pygtp_coords

# 需要导入模块: import gtp [as 别名]
# 或者: from gtp import RESIGN [as 别名]
def parse_pygtp_coords(vertex):
    'Interprets coords. (1, 1) is bottom left; (1, 9) is top left.'
    if vertex in (gtp.PASS, gtp.RESIGN):
        return None
    return go.N - vertex[1], vertex[0] - 1 
开发者ID:llSourcell,项目名称:alphago_demo,代码行数:7,代码来源:utils.py

示例4: get_move

# 需要导入模块: import gtp [as 别名]
# 或者: from gtp import RESIGN [as 别名]
def get_move(self, color):
        self.accomodate_out_of_turn(color)
        if self.should_resign(self.position):
            return gtp.RESIGN

        if self.should_pass(self.position):
            return gtp.PASS

        move = self.suggest_move(self.position)
        return utils.unparse_pygtp_coords(move) 
开发者ID:llSourcell,项目名称:alphago_demo,代码行数:12,代码来源:gtp_wrapper.py

示例5: from_pygtp

# 需要导入模块: import gtp [as 别名]
# 或者: from gtp import RESIGN [as 别名]
def from_pygtp(board_size, pygtpc):
  """Converts from a pygtp coordinate to a MiniGo coordinate."""
  # GTP has a notion of both a Pass and a Resign, both of which are mapped to
  # None, so the conversion is not precisely bijective.
  if pygtpc in (gtp.PASS, gtp.RESIGN):
    return None
  return board_size - pygtpc[1], pygtpc[0] - 1 
开发者ID:itsamitgoel,项目名称:Gun-Detector,代码行数:9,代码来源:coords.py

示例6: get_move

# 需要导入模块: import gtp [as 别名]
# 或者: from gtp import RESIGN [as 别名]
def get_move(self, color):
    self.accomodate_out_of_turn(color)
    move = self.suggest_move(self.position)
    if self.should_resign():
      return gtp.RESIGN
    return coords.to_pygtp(move) 
开发者ID:itsamitgoel,项目名称:Gun-Detector,代码行数:8,代码来源:gtp_wrapper.py

示例7: from_pygtp

# 需要导入模块: import gtp [as 别名]
# 或者: from gtp import RESIGN [as 别名]
def from_pygtp(pygtpc):
    """Converts from a pygtp coordinate to a AlphaGoZero coordinate."""
    # GTP has a notion of both a Pass and a Resign, both of which are mapped to
    # None, so the conversion is not precisely bijective.
    if pygtpc in (gtp.PASS, gtp.RESIGN):
        return None
    return GOPARAMETERS.N - pygtpc[1], pygtpc[0] - 1 
开发者ID:PacktPublishing,项目名称:Python-Reinforcement-Learning-Projects,代码行数:9,代码来源:utils.py

示例8: get_move

# 需要导入模块: import gtp [as 别名]
# 或者: from gtp import RESIGN [as 别名]
def get_move(self, color):
        self.accomodate_out_of_turn(color)
        move = self.suggest_move(self.position)
        if self.should_resign():
            return gtp.RESIGN
        return to_pygtp(move) 
开发者ID:PacktPublishing,项目名称:Python-Reinforcement-Learning-Projects,代码行数:8,代码来源:utils.py

示例9: test_gtp_vertex

# 需要导入模块: import gtp [as 别名]
# 或者: from gtp import RESIGN [as 别名]
def test_gtp_vertex(self):
        self.assertEqual(gtp_vertex((4, 4)), "D4")
        self.assertEqual(gtp_vertex((16, 16)), "Q16")
        self.assertEqual(gtp_vertex(PASS), "pass")
        self.assertEqual(gtp_vertex(RESIGN), "resign") 
开发者ID:jtauber,项目名称:gtp,代码行数:7,代码来源:test.py

示例10: unparse_pygtp_coords

# 需要导入模块: import gtp [as 别名]
# 或者: from gtp import RESIGN [as 别名]
def unparse_pygtp_coords(c):
    if c == gtp.RESIGN:
        return gtp.RESIGN
    if c is None:
        return gtp.PASS
    return c[1] + 1, go.N - c[0] 
开发者ID:brilee,项目名称:MuGo,代码行数:8,代码来源:utils.py

示例11: suggest_move

# 需要导入模块: import gtp [as 别名]
# 或者: from gtp import RESIGN [as 别名]
def suggest_move(self, position):
        if position.caps[0] + 50 < position.caps[1]:
            return gtp.RESIGN
        start = time.time()
        move_probs = self.policy_network.run(position)
        root = MCTSNode.root_node(position, move_probs)
        while time.time() - start < self.seconds_per_move:
            self.tree_search(root)
        # there's a theoretical bug here: if you refuse to pass, this AI will
        # eventually start filling in its own eyes.
        return max(root.children.keys(), key=lambda move, root=root: root.children[move].N) 
开发者ID:brilee,项目名称:MuGo,代码行数:13,代码来源:strategies.py

示例12: get_move

# 需要导入模块: import gtp [as 别名]
# 或者: from gtp import RESIGN [as 别名]
def get_move(self, color):
    self.accomodate_out_of_turn(color)
    move = self.suggest_move(self.position)
    if self.should_resign():
      return gtp.RESIGN
    return coords.to_pygtp(self.board_size, move) 
开发者ID:generalized-iou,项目名称:g-tensorflow-models,代码行数:8,代码来源:gtp_wrapper.py


注:本文中的gtp.RESIGN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。