summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-05-12 17:39:06 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-05-12 17:39:06 +0200
commit97880f6a368085e9a409f1fb0030791a4a65005c (patch)
tree85190874620d136a4797bd0d4571de6fce9859b9 /src/main.rs
parentf43fa101538c6b4ae2531bb8d27c793e6b7579ec (diff)
Initial stab at monte carlo implementation
Doesn't seem to be working quite right... just sits there accumulating energy.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 7b3a62c..e5dc3aa 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,7 +13,7 @@ use std::io::prelude::*;
use std::process;
fn choose_move(settings: &engine::settings::GameSettings, state: &engine::GameState) -> Command {
- strategy::sample::choose_move(settings, state)
+ strategy::monte_carlo::choose_move(settings, state)
}
@@ -25,10 +25,11 @@ fn write_command(filename: &str, command: Command) -> Result<(), Box<Error> > {
fn main() {
+ println!("Reading in state.json file");
let (settings, state) = match json::read_state_from_file(STATE_PATH) {
Ok(ok) => ok,
Err(error) => {
- eprintln!("Error while parsing JSON file: {}", error);
+ println!("Error while parsing JSON file: {}", error);
process::exit(1);
}
};
@@ -37,7 +38,7 @@ fn main() {
match write_command(COMMAND_PATH, command) {
Ok(()) => {}
Err(error) => {
- eprintln!("Error while writing command file: {}", error);
+ println!("Error while writing command file: {}", error);
process::exit(1);
}
}