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

Updated optimum time #556

Open
wants to merge 4 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void Parameters::setup_default_parameters() {
cfg_noise = false;
cfg_randomize = false;
cfg_timemanage = true;
cfg_slowmover = 89;
cfg_slowmover = 84;
cfg_logfile_handle = nullptr;
cfg_quiet = false;
cfg_rng_seed = 0;
Expand Down
9 changes: 7 additions & 2 deletions src/UCTSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,15 @@ Move UCTSearch::think(BoardHistory&& new_bh) {
#endif

// set up timing info

Time.init(bh_.cur().side_to_move(), bh_.cur().game_ply());
m_target_time = (Limits.movetime ? Limits.movetime : Time.optimum()) - cfg_lagbuffer_ms;
m_max_time = Time.maximum() - cfg_lagbuffer_ms;

if (Limits.movetime) {
m_target_time = Limits.movetime;
Copy link
Contributor

@Tilps Tilps May 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have the lagbuffer subtracted.

Copy link
Contributor Author

@jjoshua2 jjoshua2 May 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Limits.movetime did not have it subtracted before, so I didn't change that at all, since I'm only trying to optimize real TC

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the previous code was m_target_time = (move time conditional dependent expression) - lagbuffer.
So lag buffer was applied regardless of movetime or not.

} else {
m_target_time = std::min( (int64_t)(1.5*Time.optimum()), m_max_time );
Copy link
Contributor

@Tilps Tilps May 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 spaces on the indent here?

}

m_start_time = Limits.timeStarted();

// create a sorted list of legal moves (make sure we
Expand Down