Skip to main content

ProblemSpec

Trait ProblemSpec 

Source
pub trait ProblemSpec<S, C>{
    // Required methods
    fn is_trivial(&self, solution: &S) -> bool;
    fn default_time_limit_secs(&self) -> u64;
    fn log_scale(&self, solution: &S);
    fn build_and_solve(
        self,
        director: ScoreDirector<S, C>,
        config: &SolverConfig,
        time_limit: Duration,
        termination: AnyTermination<S, ScoreDirector<S, C>>,
        terminate: Option<&AtomicBool>,
        callback: impl Fn(&S) + Send + Sync,
    ) -> SolveResult<S>;
}
Expand description

Parameterizes run_solver over basic-variable and list-variable problems.

Implementors supply problem-specific trivial-case detection, logging, default time limit, and the actual construction + local search execution.

Required Methods§

Source

fn is_trivial(&self, solution: &S) -> bool

Source

fn default_time_limit_secs(&self) -> u64

Source

fn log_scale(&self, solution: &S)

Source

fn build_and_solve( self, director: ScoreDirector<S, C>, config: &SolverConfig, time_limit: Duration, termination: AnyTermination<S, ScoreDirector<S, C>>, terminate: Option<&AtomicBool>, callback: impl Fn(&S) + Send + Sync, ) -> SolveResult<S>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<S, C> ProblemSpec<S, C> for BasicSpec<S>

Source§

impl<S, V, C, DM, IDM> ProblemSpec<S, C> for ListSpec<S, V, DM, IDM>
where S: PlanningSolution, S::Score: Score + ParseableScore, V: Copy + PartialEq + Eq + Hash + Send + Sync + Debug + 'static, C: ConstraintSet<S, S::Score>, DM: CrossEntityDistanceMeter<S> + Clone, IDM: CrossEntityDistanceMeter<S> + Clone + 'static,