pub struct DiscrepancyRule { /* private fields */ }Expand description
Limited discrepancy search (LDS-DL8.5).
Features are ranked by the heuristic at each node, and taking the feature
of rank i costs a discrepancy of i. A pass explores only the paths
whose total discrepancy is within the budget; relaxing the rule raises the
budget, following its StepStrategy, until it covers the whole space.
Kiossou, Schaus, Nijssen and Houndji, Time Constrained DL8.5 Using Limited Discrepancy Search (ECML PKDD 2022).
Implementations§
Source§impl DiscrepancyRule
impl DiscrepancyRule
Sourcepub fn new(limit: usize, increment: Box<dyn StepStrategy>) -> Self
pub fn new(limit: usize, increment: Box<dyn StepStrategy>) -> Self
A rule whose budget grows following increment, up to limit.
Sourcepub fn with_priority(self, priority: u8) -> Self
pub fn with_priority(self, priority: u8) -> Self
Sets the evaluation priority.
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 the budget of the first pass.
Sourcepub fn update_to_true_limit(
&mut self,
nb_candidates: usize,
remaining_depth: usize,
)
pub fn update_to_true_limit( &mut self, nb_candidates: usize, remaining_depth: usize, )
Lowers the limit to the largest discrepancy a tree of
remaining_depth levels over nb_candidates features can have.
Trait Implementations§
Source§impl Default for DiscrepancyRule
impl Default for DiscrepancyRule
Source§impl Rule for DiscrepancyRule
impl Rule for DiscrepancyRule
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 DiscrepancyRule
impl !UnwindSafe for DiscrepancyRule
impl Freeze for DiscrepancyRule
impl Send for DiscrepancyRule
impl Sync for DiscrepancyRule
impl Unpin for DiscrepancyRule
impl UnsafeUnpin for DiscrepancyRule
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