solverforge_solver/phase/partitioned/
config.rs1use solverforge_config::MoveThreadCount;
4
5use super::partitioner::ThreadCount;
6
7#[derive(Debug, Clone)]
9pub struct PartitionedSearchConfig {
10 pub thread_count: ThreadCount,
12 pub log_progress: bool,
14}
15
16impl Default for PartitionedSearchConfig {
17 fn default() -> Self {
18 Self {
19 thread_count: ThreadCount::Auto,
20 log_progress: false,
21 }
22 }
23}
24
25impl PartitionedSearchConfig {
26 pub fn from_serialized(config: &solverforge_config::PartitionedSearchConfig) -> Self {
27 Self {
28 thread_count: match config.thread_count {
29 MoveThreadCount::Auto => ThreadCount::Auto,
30 MoveThreadCount::None => ThreadCount::Specific(1),
31 MoveThreadCount::Count(count) => ThreadCount::Specific(count.max(1)),
32 },
33 log_progress: config.log_progress,
34 }
35 }
36}