Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change min time to 1ms from 0ms #1054

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/engine_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ def single_move_time(board: chess.Board, game: model.Game, search_time: datetime
"""
pre_move_time = setup_timer.time_since_reset()
overhead = pre_move_time + move_overhead
clock_time = max(msec(0), msec(game.state[wbtime(board)]) - overhead)
clock_time = max(msec(1), msec(game.state[wbtime(board)]) - overhead)
search_time = min(search_time, clock_time)
logger.info(f"Searching for time {sec_str(search_time)} seconds for game {game.id}")
return chess.engine.Limit(time=to_seconds(search_time), clock_id="correspondence")
Expand Down Expand Up @@ -724,7 +724,7 @@ def game_clock_time(board: chess.Board,
overhead = pre_move_time + move_overhead
times = {"wtime": msec(game.state["wtime"]), "btime": msec(game.state["btime"])}
side = wbtime(board)
times[side] = max(msec(0), times[side] - overhead)
times[side] = max(msec(1), times[side] - overhead)
logger.info(f"Searching for wtime {msec_str(times['wtime'])} btime {msec_str(times['btime'])} for game {game.id}")
return chess.engine.Limit(white_clock=to_seconds(times["wtime"]),
black_clock=to_seconds(times["btime"]),
Expand Down
Loading