1use schemars::JsonSchema;
2use serde::Serialize;
3use serde_with::skip_serializing_none;
45use crate::solver::SolverFamily;
67#[skip_serializing_none]
8#[derive(Default, Serialize, Clone, JsonSchema, Debug)]
9#[serde(rename_all = "camelCase")]
10#[allow(dead_code)]
11// Statistics for a run of a solver.
12pub struct SolverStats {
13#[serde(rename = "conjureSolverWallTime_s")]
14/// Wall time as measured by Conjure-Oxide (not the solver).
15pub conjure_solver_wall_time_s: f64,
1617// This is set by Solver, not SolverAdaptor
18/// The solver family used for this run.
19pub solver_family: Option<SolverFamily>,
2021/// The solver adaptor used for this run.
22pub solver_adaptor: Option<String>,
2324// NOTE (niklasdewally): these fields are copied from the list in Savile Row
25pub nodes: Option<u64>,
26pub satisfiable: Option<bool>,
27pub sat_vars: Option<u64>,
28pub sat_clauses: Option<u64>,
29}
3031impl SolverStats {
32// Adds the conjure_solver_wall_time_s to the stats.
33pub fn with_timings(self, wall_time_s: f64) -> SolverStats {
34 SolverStats {
35 conjure_solver_wall_time_s: wall_time_s,
36 ..self.clone()
37 }
38 }
39}