use std::time::Duration;
use crate::egraph::EGraphConfig;
#[derive(Debug, Clone, Copy)]
pub struct HeuristicConfig {
pub max_depth: usize,
pub branch_factor: usize,
pub timeout: Duration,
pub simplification_aggressiveness: f64,
pub use_egraph: bool,
pub egraph_config: EGraphConfig,
}
impl Default for HeuristicConfig {
fn default() -> Self {
Self {
max_depth: 10,
branch_factor: 4,
timeout: Duration::from_millis(500),
simplification_aggressiveness: 0.1,
use_egraph: false,
egraph_config: EGraphConfig::default(),
}
}
}
impl HeuristicConfig {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub const fn with_egraph(mut self, cfg: EGraphConfig) -> Self {
self.use_egraph = true;
self.egraph_config = cfg;
self
}
#[must_use]
pub const fn max_depth(mut self, depth: usize) -> Self {
self.max_depth = depth;
self
}
#[must_use]
pub const fn branch_factor(mut self, factor: usize) -> Self {
self.branch_factor = factor;
self
}
#[must_use]
pub const fn timeout(mut self, timeout: Duration) -> Self {
self.timeout = timeout;
self
}
#[must_use]
pub const fn simplification_aggressiveness(mut self, aggressiveness: f64) -> Self {
self.simplification_aggressiveness = aggressiveness;
self
}
}