fix bots
This commit is contained in:
1 parent
1076c6dc06
commit
19e0b74bd8
4 files changed
+5
-2
No files matched your search
@@ -110,6 +110,7 @@ while True:
|
||||
while len(handicaps) < min(n, bx * by): # really obscure cases
|
||||
handicaps.add(Move((random.randint(0, bx - 1), random.randint(0, by - 1)), player="B").sgf(board_size=game.board_size))
|
||||
game.root.set_property("AB", list(handicaps))
|
||||
game._calculate_groups()
|
||||
gtp = [Move.from_sgf(m, game.board_size, "B").gtp() for m in handicaps]
|
||||
logger.log(f"Chose handicap placements as {gtp}", OUTPUT_ERROR)
|
||||
print(f"= {' '.join(gtp)}\n")
|
||||
@@ -119,6 +120,7 @@ while True:
|
||||
elif "set_free_handicap" in line:
|
||||
_, *stones = line.split(" ")
|
||||
game.root.set_property("AB", [Move.from_gtp(move.upper()).sgf(game.board_size) for move in stones])
|
||||
game._calculate_groups()
|
||||
logger.log(f"Set handicap placements to {game.root.get_list_property('AB')}", OUTPUT_ERROR)
|
||||
elif "genmove" in line:
|
||||
_, player = line.strip().split(" ")
|
||||
|
||||
+1
-1
@@ -233,7 +233,7 @@ class Game:
|
||||
return self.current_node.format_score(score)
|
||||
|
||||
def __repr__(self):
|
||||
return "\n".join("".join(Move.PLAYERS[self.chains[c][0].player] if c >= 0 else "-" for c in line) for line in self.board) + f"\ncaptures: {self.prisoner_count}"
|
||||
return "\n".join("".join(self.chains[c][0].player if c >= 0 else "-" for c in line) for line in self.board) + f"\ncaptures: {self.prisoner_count}"
|
||||
|
||||
def write_sgf(self, path=None, trainer_config={}, save_feedback=(True,), eval_thresholds=(0,)):
|
||||
black, white = self.root.get_property("PB"), self.root.get_property("PW")
|
||||
|
||||
@@ -178,6 +178,7 @@ class ConfigPopup(QuickConfigGui):
|
||||
self.katrain.game.engines = {"B": new_engine, "W": new_engine}
|
||||
self.katrain.game.analyze_all_nodes() # old engine was possibly broken, so make sure we redo any failures
|
||||
self.katrain.update_state()
|
||||
|
||||
Clock.schedule_once(restart_engine, 0)
|
||||
|
||||
self.katrain.debug_level = self.config["debug"]["level"]
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ class KaTrainGui(BoxLayout):
|
||||
self.controls.set_status(f"KataGo is tuning settings for first startup, please wait." + message)
|
||||
if "ready" in message.lower():
|
||||
self.controls.set_status(f"KataGo engine ready.")
|
||||
print(f"[KG:STDERR]{message}")
|
||||
print(f"[KG:STDERR]{message.strip()}")
|
||||
elif level == OUTPUT_ERROR:
|
||||
self.controls.set_status(f"ERROR: {message}")
|
||||
print(f"ERROR: {message}")
|
||||
|
||||
Reference in new issue
Block a user