pub struct SolveBudgets {
pub time_limit: Duration,
pub iteration_limit: usize,
pub candidate_cap: usize,
pub memory_limit_bytes: usize,
}Expand description
Resource budgets for solver execution
Fields§
§time_limit: DurationMaximum wall-clock time for solving (in seconds)
iteration_limit: usizeMaximum solver iterations
candidate_cap: usizeMaximum candidate solutions to evaluate
memory_limit_bytes: usizeMaximum memory usage (bytes, 0 = unlimited)
Implementations§
Source§impl SolveBudgets
impl SolveBudgets
Sourcepub fn with_time_limit(seconds: u64) -> Self
pub fn with_time_limit(seconds: u64) -> Self
Create budgets with time limit only
Sourcepub fn strict(time_seconds: u64, iterations: usize, candidates: usize) -> Self
pub fn strict(time_seconds: u64, iterations: usize, candidates: usize) -> Self
Create strict budgets for testing
Sourcepub fn to_solver_params(&self, seed: u64) -> SolverParams
pub fn to_solver_params(&self, seed: u64) -> SolverParams
Convert to SolverParams for existing solvers
Sourcepub fn has_time_remaining(&self, elapsed: Duration) -> bool
pub fn has_time_remaining(&self, elapsed: Duration) -> bool
Check if time budget allows more work
Trait Implementations§
Source§impl Clone for SolveBudgets
impl Clone for SolveBudgets
Source§fn clone(&self) -> SolveBudgets
fn clone(&self) -> SolveBudgets
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 SolveBudgets
impl Debug for SolveBudgets
Source§impl Default for SolveBudgets
impl Default for SolveBudgets
Source§impl<'de> Deserialize<'de> for SolveBudgets
impl<'de> Deserialize<'de> for SolveBudgets
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 SolveBudgets
impl RefUnwindSafe for SolveBudgets
impl Send for SolveBudgets
impl Sync for SolveBudgets
impl Unpin for SolveBudgets
impl UnsafeUnpin for SolveBudgets
impl UnwindSafe for SolveBudgets
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