Skip to content

Commit 7153f45

Browse files
committed
Merge pull request #133 from ujh/release-0.2.0
Release 0.2.0
2 parents 002bd60 + 2949679 commit 7153f45

File tree

9 files changed

+36
-19
lines changed

9 files changed

+36
-19
lines changed

Diff for: CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.2.0 [](https://github.com/ujh/iomrascalai/compare/0.1.7...0.2.0)
2+
3+
* UCT engine
4+
* A new playout policy that doesn't put large strings into self atari
5+
16
## 0.1.7 [](https://github.com/ujh/iomrascalai/compare/0.1.6...0.1.7)
27

38
* Improvements of the playout speeds

Diff for: Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
description = "An AI for the game of Go"
44
name = "iomrascalai"
5-
version = "0.2.0-rc3"
5+
version = "0.2.0"
66
authors = ["Urban Hafner <[email protected]>",
77
"Thomas Poinsot <[email protected]>",
88
"Igor Polyakov <[email protected]>"]

Diff for: src/engine/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ pub fn factory(opt: Option<String>, config: Arc<Config>) -> Box<Engine> {
4949
match s.as_ref() {
5050
"random" => Box::new(RandomEngine::new()),
5151
"mc" => Box::new(SimpleMcEngine::new(config.clone())),
52-
"uct" => Box::new(UctEngine::new(config.clone())),
53-
_ => Box::new(AmafMcEngine::new(config.clone())),
52+
"amaf" => Box::new(AmafMcEngine::new(config.clone())),
53+
_ => Box::new(UctEngine::new(config.clone())),
5454
}
5555
},
56-
None => Box::new(AmafMcEngine::new(config.clone()))
56+
None => Box::new(UctEngine::new(config.clone()))
5757
}
5858
}
5959

Diff for: src/engine/test.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ use config::Config;
2626
use std::sync::Arc;
2727

2828
#[test]
29-
fn factory_returns_amaf_by_default() {
29+
fn factory_returns_uct_by_default() {
3030
let engine = super::factory(None, Arc::new(Config::default()));
31-
assert_eq!("amaf", engine.engine_type());
31+
assert_eq!("uct", engine.engine_type());
3232
}
3333

3434
#[test]
@@ -44,7 +44,13 @@ fn factory_returns_simple_mc_when_given_mc() {
4444
}
4545

4646
#[test]
47-
fn factory_rutuyrns_amaf_for_any_other_string() {
48-
let engine = super::factory(Some(String::from_str("foo")), Arc::new(Config::default()));
47+
fn factory_returns_amaf_when_given_amaf() {
48+
let engine = super::factory(Some(String::from_str("amaf")), Arc::new(Config::default()));
4949
assert_eq!("amaf", engine.engine_type());
5050
}
51+
52+
#[test]
53+
fn factory_returns_uct_for_any_other_string() {
54+
let engine = super::factory(Some(String::from_str("foo")), Arc::new(Config::default()));
55+
assert_eq!("uct", engine.engine_type());
56+
}

Diff for: src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ mod version;
7171
pub fn main() {
7272
let mut opts = Options::new();
7373
let args : Vec<String> = args().collect();
74-
opts.optopt("e", "engine", "select an engine (defaults to amaf)", "amaf|mc|random|uct");
74+
opts.optopt("e", "engine", "select an engine (defaults to uct)", "amaf|mc|random|uct");
7575
opts.optopt("r", "ruleset", "select the ruleset (defaults to chinese)", "cgos|chinese|tromp-taylor|minimal");
7676
opts.optopt("t", "threads", "number of threads to use (defaults to 1)", "NUM");
77-
opts.optopt("p", "playout", "type of playout to use (defaults to light)", "light|no-self-atari");
77+
opts.optopt("p", "playout", "type of playout to use (defaults to no-self-atari)", "light|no-self-atari");
7878
opts.optflag("h", "help", "print this help menu");
7979
opts.optflag("v", "version", "print the version number");
8080
opts.optflag("l", "log", "log to stderr (defaults to false)");

Diff for: src/playout/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ mod test;
3434

3535
pub fn factory(opt: Option<String>) -> Box<Playout> {
3636
match opt.as_ref().map(::std::ops::Deref::deref) {
37-
Some("no-self-atari") => Box::new(NoSelfAtariPlayout),
38-
_ => Box::new(NoEyesPlayout),
37+
Some("light") => Box::new(NoEyesPlayout),
38+
_ => Box::new(NoSelfAtariPlayout),
3939
}
4040
}
4141

4242
pub trait Playout: Sync + Send {
4343

4444
fn run(&self, board: &mut Board, initial_move: Option<&Move>, rng: &mut XorShiftRng) -> PlayoutResult {
4545
let mut played_moves = Vec::new();
46-
46+
4747
initial_move.map(|&m| {
4848
board.play_legal_move(m);
4949
played_moves.push(m);

Diff for: src/playout/test/mod.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,19 @@
2424
mod no_eyes;
2525

2626
#[test]
27-
fn factory_returns_no_eyes_by_default() {
27+
fn factory_returns_no_self_atari_by_default() {
2828
let playout = super::factory(None);
29-
assert_eq!("NoEyesPlayout", playout.playout_type());
29+
assert_eq!("NoSelfAtariPlayout", playout.playout_type());
3030
}
3131

3232
#[test]
33-
fn factroy_returns_no_eyes_when_given_any_string() {
33+
fn factory_returns_no_self_atari_when_given_any_string() {
3434
let playout = super::factory(Some(String::from_str("foo")));
35+
assert_eq!("NoSelfAtariPlayout", playout.playout_type());
36+
}
37+
38+
#[test]
39+
fn factory_returns_no_eyes_when_given_light() {
40+
let playout = super::factory(Some(String::from_str("light")));
3541
assert_eq!("NoEyesPlayout", playout.playout_type());
36-
}
42+
}

Diff for: src/version.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
************************************************************************/
2121

2222
pub fn version() -> &'static str {
23-
"0.2.0-rc3"
23+
"0.2.0"
2424
}

0 commit comments

Comments
 (0)