Skip to content

Commit

Permalink
Fix time manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
gikou-official committed May 7, 2017
1 parent 5a84197 commit 6d7f198
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/time_manager.cc
Expand Up @@ -146,18 +146,18 @@ bool TimeManager::EnoughTimeIsAvailableForNextIteration() const {

void TimeManager::Run() {
while (!stop_) {
// Step 1. 消費時間ベースの打ち切り
// Step 1. 最小思考時間を下回っているときは、打ち切りを行わない
if (expended_time() < time_control_->minimum_time()) {
goto sleep;
}

// Step 2. 消費時間ベースの打ち切り
// 消費時間が最大思考時間を上回ったら思考を直ちに終了する(切れ負けを防ぐ)
if (expended_time() >= time_control_->maximum_time()) {
HandleTimeUpEvent();
break;
}

// Step 2. 最小思考時間を下回っているときは、打ち切りを行わない
if (expended_time() < time_control_->minimum_time()) {
goto sleep;
}

// Step 3. 経過時間ベースの打ち切り
// 経過時間が、目標時間を上回ったら思考を終了する(fail-low時を除く)
if ( !panic_mode_
Expand Down

0 comments on commit 6d7f198

Please sign in to comment.