Skip to content

Commit d9e0af0

Browse files
committed
Add tree search node count as CLI option.
1 parent 9c1abc5 commit d9e0af0

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

python/miniacd/cli.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ def random_rgb() -> tuple[int, int, int]:
6060
type=click.IntRange(min=0),
6161
help="Monte Carlo tree search search iterations",
6262
)
63+
@click.option(
64+
"--mcts-nodes",
65+
default=20,
66+
type=click.IntRange(min=0),
67+
help="The discretization size in the Monte Carlo tree search",
68+
)
6369
@click.option(
6470
"--seed",
6571
default=42,
@@ -75,6 +81,7 @@ def main(
7581
threshold: float,
7682
mcts_depth: int,
7783
mcts_iterations: int,
84+
mcts_nodes: int,
7885
seed: int,
7986
):
8087
"""
@@ -89,6 +96,7 @@ def main(
8996
threshold=threshold,
9097
max_depth=mcts_depth,
9198
iterations=mcts_iterations,
99+
num_nodes=mcts_nodes,
92100
random_seed=seed,
93101
print=True,
94102
)

src/py.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ mod pyminiacd {
4141
threshold=0.1,
4242
iterations=150,
4343
max_depth=3,
44+
num_nodes=20,
4445
random_seed=42,
4546
print=true))]
4647
fn run(
4748
mesh: &PyMesh,
4849
threshold: f64,
4950
iterations: usize,
5051
max_depth: usize,
52+
num_nodes: usize,
5153
random_seed: u64,
5254
print: bool,
5355
) -> Vec<PyMesh> {
@@ -56,7 +58,7 @@ mod pyminiacd {
5658
iterations,
5759
max_depth,
5860
exploration_param: f64::sqrt(2.0),
59-
num_nodes: 20,
61+
num_nodes,
6062
random_seed,
6163
print,
6264
};

0 commit comments

Comments
 (0)