pub struct DecreasingTopkRule { /* private fields */ }Expand description
Like TopkRule, but the number of features allowed halves at each
level: k / 2^depth, and at least one.
Implementations§
Source§impl DecreasingTopkRule
impl DecreasingTopkRule
Sourcepub fn new(limit: usize, increment: Box<dyn StepStrategy>) -> Self
pub fn new(limit: usize, increment: Box<dyn StepStrategy>) -> Self
A rule whose root k grows following increment, up to limit.
Sourcepub fn with_delay(self, delay: u8) -> Self
pub fn with_delay(self, delay: u8) -> Self
Sets the number of passes before the rule takes effect.
Sourcepub fn with_budget(self, budget: usize) -> Self
pub fn with_budget(self, budget: usize) -> Self
Sets k for the first pass.
Trait Implementations§
Source§impl Rule for DecreasingTopkRule
impl Rule for DecreasingTopkRule
Source§fn evaluate(&self, context: &RuleContext) -> RuleResult
fn evaluate(&self, context: &RuleContext) -> RuleResult
Decides whether the search continues below the node.
Source§fn description(&self) -> String
fn description(&self) -> String
A short human-readable name.
Source§fn deactivate(&mut self)
fn deactivate(&mut self)
Stops applying the rule.
Source§fn relax(&mut self)
fn relax(&mut self)
Widens the rule’s budget before the next pass, or deactivates it once
the budget is at its limit.
Source§fn is_relaxable(&self) -> bool
fn is_relaxable(&self) -> bool
Whether the rule restricts the search only temporarily. A search whose
pass was cut by a relaxable rule is not finished.
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Upcast used by
RuleManager::get_rule_mut.Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Mutable upcast used by
RuleManager::get_rule_mut.Auto Trait Implementations§
impl !RefUnwindSafe for DecreasingTopkRule
impl !UnwindSafe for DecreasingTopkRule
impl Freeze for DecreasingTopkRule
impl Send for DecreasingTopkRule
impl Sync for DecreasingTopkRule
impl Unpin for DecreasingTopkRule
impl UnsafeUnpin for DecreasingTopkRule
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