summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-07-02 22:08:51 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-07-02 22:08:51 +0200
commit8e44d57fdb1c7be69501ebdfc5f9f5d48642b065 (patch)
tree34ffbf39a94283f4d1bdcf77dc439ac2b5f4f763 /src/bin
parent8251d5899a64515c9b2e8a71349dd4d2fcece69e (diff)
Initial drop in replacement implementation
It's faster than the other one! Doesn't tesla yet, but still! Yay!
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/perf-test.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/bin/perf-test.rs b/src/bin/perf-test.rs
index 42b4def..81dc5a5 100644
--- a/src/bin/perf-test.rs
+++ b/src/bin/perf-test.rs
@@ -9,6 +9,12 @@ const STATE_PATH: &str = "tests/state0.json";
use std::process;
fn main() {
+// expressive();
+ bitwise();
+}
+
+fn expressive() {
+ println!("Running expressive engine");
let start_time = PreciseTime::now();
let (settings, state) = match input::json::read_expressive_state_from_file(STATE_PATH) {
Ok(ok) => ok,
@@ -20,3 +26,17 @@ fn main() {
let max_time = Duration::milliseconds(1950);
strategy::monte_carlo::choose_move(&settings, &state, &start_time, max_time);
}
+
+fn bitwise() {
+ println!("Running bitwise engine");
+ let start_time = PreciseTime::now();
+ let (settings, state) = match input::json::read_bitwise_state_from_file(STATE_PATH) {
+ Ok(ok) => ok,
+ Err(error) => {
+ println!("Error while parsing JSON file: {}", error);
+ process::exit(1);
+ }
+ };
+ let max_time = Duration::milliseconds(1950);
+ strategy::monte_carlo::choose_move(&settings, &state, &start_time, max_time);
+}