pub struct SolverReport {
pub solver_id: String,
pub feasible: bool,
pub objective_value: Option<f64>,
pub constraint_violations: Vec<Violation>,
pub diagnostics: Vec<Diagnostic>,
pub stop_reason: StopReason,
pub replay: ReplayEnvelope,
}Expand description
Detailed solver execution report
Fields§
§solver_id: StringSolver identifier
feasible: boolWhether a feasible solution was found
objective_value: Option<f64>Objective value (if solution found)
constraint_violations: Vec<Violation>Constraint violations
diagnostics: Vec<Diagnostic>Diagnostic information
stop_reason: StopReasonWhy the solver stopped
replay: ReplayEnvelopeReplay information
Implementations§
Source§impl SolverReport
impl SolverReport
Sourcepub fn optimal(
solver_id: impl Into<String>,
objective_value: f64,
replay: ReplayEnvelope,
) -> Self
pub fn optimal( solver_id: impl Into<String>, objective_value: f64, replay: ReplayEnvelope, ) -> Self
Create a feasible report with optimal solution
Sourcepub fn feasible(
solver_id: impl Into<String>,
objective_value: f64,
stop_reason: StopReason,
replay: ReplayEnvelope,
) -> Self
pub fn feasible( solver_id: impl Into<String>, objective_value: f64, stop_reason: StopReason, replay: ReplayEnvelope, ) -> Self
Create a feasible report (may not be optimal)
Sourcepub fn infeasible(
solver_id: impl Into<String>,
violations: Vec<Violation>,
stop_reason: StopReason,
replay: ReplayEnvelope,
) -> Self
pub fn infeasible( solver_id: impl Into<String>, violations: Vec<Violation>, stop_reason: StopReason, replay: ReplayEnvelope, ) -> Self
Create an infeasible report
Sourcepub fn with_diagnostic(self, diag: Diagnostic) -> Self
pub fn with_diagnostic(self, diag: Diagnostic) -> Self
Add a diagnostic
Sourcepub fn with_diagnostics(
self,
diags: impl IntoIterator<Item = Diagnostic>,
) -> Self
pub fn with_diagnostics( self, diags: impl IntoIterator<Item = Diagnostic>, ) -> Self
Add multiple diagnostics
Sourcepub fn with_violation(self, violation: Violation) -> Self
pub fn with_violation(self, violation: Violation) -> Self
Add a constraint violation
Sourcepub fn is_optimal(&self) -> bool
pub fn is_optimal(&self) -> bool
Check if solution is proven optimal
Sourcepub fn hit_budget(&self) -> bool
pub fn hit_budget(&self) -> bool
Check if solver hit a budget limit
Trait Implementations§
Source§impl Clone for SolverReport
impl Clone for SolverReport
Source§fn clone(&self) -> SolverReport
fn clone(&self) -> SolverReport
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SolverReport
impl Debug for SolverReport
Source§impl<'de> Deserialize<'de> for SolverReport
impl<'de> Deserialize<'de> for SolverReport
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SolverReport
impl RefUnwindSafe for SolverReport
impl Send for SolverReport
impl Sync for SolverReport
impl Unpin for SolverReport
impl UnsafeUnpin for SolverReport
impl UnwindSafe for SolverReport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more