From a96424cf8a90aa93edcf4e9ff11fc54800ea1b9e Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Sat, 21 Jul 2018 20:40:40 +0200 Subject: Simplified duration handling to allow longer profiling --- src/main.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 752e8b9..0235d5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ extern crate time; use time::{PreciseTime, Duration}; use zombot::*; +use zombot::engine::constants::*; use zombot::engine::command::Command; use std::error::Error; @@ -16,16 +17,7 @@ use std::io::prelude::*; use std::process; fn choose_move(settings: &engine::settings::GameSettings, state: &GS, start_time: &PreciseTime) -> Command { - #[cfg(not(feature = "reduced-time"))] - #[cfg(not(feature = "extended-time"))] - let max_time = Duration::milliseconds(1950); - - #[cfg(feature = "reduced-time")] - let max_time = Duration::milliseconds(950); - - #[cfg(feature = "extended-time")] - let max_time = Duration::milliseconds(19950); - + let max_time = Duration::milliseconds(MAX_TIME_MILLIS); strategy::monte_carlo::choose_move(settings, state, start_time, max_time) } -- cgit v1.2.3