Skip to content

Commit

Permalink
fix-cyclical-time-management (#175)
Browse files Browse the repository at this point in the history
bench: 4084159
  • Loading branch information
connormcmonigle authored Oct 26, 2023
1 parent 0753b6e commit 4721372
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/engine/time_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct iter_info {
};

struct time_manager {
static constexpr auto over_head = std::chrono::milliseconds(5);
static constexpr auto over_head = std::chrono::milliseconds(50);

std::mutex access_mutex_;

Expand Down
3 changes: 3 additions & 0 deletions src/engine/time_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ time_manager& time_manager::init(const bool& pov, const go::moves_to_go& data) n
min_budget = 2 * (remaining - over_head) / (3 * data.moves_to_go);
max_budget = 10 * (remaining - over_head) / (3 * data.moves_to_go);

min_budget = std::min(4 * (remaining - over_head) / 5, *min_budget);
max_budget = std::min(4 * (remaining - over_head) / 5, *max_budget);

return *this;
}

Expand Down

0 comments on commit 4721372

Please sign in to comment.