-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathleave.txt
77 lines (49 loc) · 3.08 KB
/
leave.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
(Things documented in this file are unstable.)
BASICS OF GENERATING LEAVE FILES
These rudimentary tools generate somewhat usable leave files. See the options:
cargo run --release --bin leave
cargo run --release --bin buildlex
The first step is to play many games. Each run saves (a certain number of
games) to (a pair of random filenames) such as log-60abcdef. The name depends
on the time, so do not start two of these on or near the same second.
Run either of these, they mean the same thing, that is, run with no leaves:
cargo run --release --bin leave -- english-autoplay CSW24.kwg
cargo run --release --bin leave -- english-autoplay CSW24.kwg - -
cargo run --release --bin leave -- english-autoplay CSW24.kwg - - 1000000
The second step is to summarize that:
cargo run --release --bin leave -- english-summarize log-12345678 summary.csv
With the bash shell it's possible to combine multiple log files:
cargo run --release --bin leave -- english-summarize <( cat log-* ) summary.csv
The third step is either of these. Choose one or both:
cargo run --release --bin leave -- english-generate-no-smooth summary.csv leaves-no-smooth.csv
cargo run --release --bin leave -- english-generate summary.csv leaves-smooth.csv
Next, compile it to klv2 (or klv):
cargo run --release --bin buildlex -- english-klv2 leaves-no-smooth.csv leaves-no-smooth.klv2
cargo run --release --bin buildlex -- english-klv2 leaves-smooth.csv leaves-smooth.klv2
Repeat from first step as necessary, but specify the new leave files:
cargo run --release --bin leave -- english-autoplay CSW24.kwg leaves-smooth.klv2 leaves-no-smooth.klv2
After the kwg are the klv for player0 and player1, these need not be the same.
With the bash shell, to use the same leave file, attach the {,} without space:
cargo run --release --bin leave -- english-autoplay CSW24.kwg leaves-smooth.klv2{,}
Specify "-" for no leave (this is default for both), but is necessary if
player0 is using no leave and player1 is using a leave file.
GENERATING LEAVE FILES
The easier way to generate leaves is to use genleaves.sh.
This script runs n1 games with no leaves, n2 games with leave1, etc.
Run it with no parameters to see how to use it.
Advanced functionalities the script demonstrates include:
- english-autoplay-summarize to autoplay and summarize in one run.
- english-autoplay-summarize-only to not save the logs (because they are big).
- english-autoplay-summarize-breadth to try to sample more distinct racks.
(This mode is slow.)
- english-autoplay-summarize-only-breadth for both of the above.
- english-generate-full to generate full rack leaves instead of just up to n-1.
- english-generate-full-no-smooth for both full and no smooth.
- english-klv for klv1 in case that is still useful.
- leaves for the super distribution.
We used to generate leaves with
../genleaves.sh english english 2000000 2000000 2000000
That generated okay leaves in decent time.
It is debatable what arguments will generate the best leaves.
Use --breadth and --full to generate more correct leaves for pass,
but they need many more games (minimum 5000000) and therefore time and space.