pub struct GridSearchOptimizer {
pub range_widths: Vec<Decimal>,
pub constraints: OptimizationConstraints,
}Expand description
Grid search optimizer for finding optimal parameters.
Fields§
§range_widths: Vec<Decimal>Grid of range widths to search.
constraints: OptimizationConstraintsConstraints to apply.
Implementations§
Source§impl GridSearchOptimizer
impl GridSearchOptimizer
Sourcepub fn with_widths(widths: Vec<Decimal>) -> Self
pub fn with_widths(widths: Vec<Decimal>) -> Self
Creates a grid search optimizer with custom widths.
Sourcepub fn with_constraints(self, constraints: OptimizationConstraints) -> Self
pub fn with_constraints(self, constraints: OptimizationConstraints) -> Self
Sets the constraints.
Sourcepub fn generate_grid(min: Decimal, max: Decimal, steps: usize) -> Vec<Decimal>
pub fn generate_grid(min: Decimal, max: Decimal, steps: usize) -> Vec<Decimal>
Generates a fine-grained grid between min and max.
Sourcepub fn filter_valid_widths(&self) -> Vec<Decimal>
pub fn filter_valid_widths(&self) -> Vec<Decimal>
Filters candidates based on constraints.
Sourcepub fn rank_candidates(candidates: &mut [CandidateResult])
pub fn rank_candidates(candidates: &mut [CandidateResult])
Ranks candidates by score (descending).
Sourcepub fn top_n(candidates: &[CandidateResult], n: usize) -> Vec<CandidateResult>
pub fn top_n(candidates: &[CandidateResult], n: usize) -> Vec<CandidateResult>
Returns the top N candidates.
Trait Implementations§
Source§impl Clone for GridSearchOptimizer
impl Clone for GridSearchOptimizer
Source§fn clone(&self) -> GridSearchOptimizer
fn clone(&self) -> GridSearchOptimizer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 GridSearchOptimizer
impl Debug for GridSearchOptimizer
Auto Trait Implementations§
impl Freeze for GridSearchOptimizer
impl RefUnwindSafe for GridSearchOptimizer
impl Send for GridSearchOptimizer
impl Sync for GridSearchOptimizer
impl Unpin for GridSearchOptimizer
impl UnsafeUnpin for GridSearchOptimizer
impl UnwindSafe for GridSearchOptimizer
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