Skip to main content

DomainCostEval

Trait DomainCostEval 

Source
pub trait DomainCostEval<D: Domain> {
    // Required methods
    fn cost(&self, domain: &D, val: &D::Value) -> f64;
    fn min_cost(&self, domain: &D) -> f64;
    fn max_cost(&self, domain: &D) -> f64;
}
Expand description

Cost evaluator for domains. Passed into the optimizer so that the same search code works for both CostDomain and plain Domain (zero cost).

Required Methods§

Source

fn cost(&self, domain: &D, val: &D::Value) -> f64

Cost of assigning val to the variable whose current domain is domain.

Source

fn min_cost(&self, domain: &D) -> f64

Lower bound on the minimum cost achievable from domain.

Source

fn max_cost(&self, domain: &D) -> f64

Upper bound on the maximum cost achievable from domain.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§