summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-07-21 20:40:40 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-07-21 20:40:40 +0200
commita96424cf8a90aa93edcf4e9ff11fc54800ea1b9e (patch)
treefdc97af8d5a461f17972debafd00a9b4648b40aa /src/main.rs
parent2cc0a6ff93b2e0dc20ba75c18ce34881bf3d9fbe (diff)
Simplified duration handling to allow longer profiling
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs12
1 files changed, 2 insertions, 10 deletions
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<GS:engine::GameState>(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)
}