pub struct LearnedRule<C = f32, Q = usize, S = usize>where
Q: RawState,{
pub confidence: C,
pub rule: Rule<Q, S>,
}Expand description
A LearnedRule is an extension of the basic Rule structure, incorporating a
confidence metric to quantify the reliability or certainty of the rule within the scope of
a learning context. This is particularly useful in scenarios where rules are derived from
data or experience, allowing for a more nuanced application of rules based on their
confidence levels.
Fields§
§confidence: C§rule: Rule<Q, S>Implementations§
Source§impl<T, Q, S> LearnedRule<T, Q, S>where
Q: RawState,
impl<T, Q, S> LearnedRule<T, Q, S>where
Q: RawState,
Sourcepub const fn new(head: Head<Q, S>, tail: Tail<Q, S>, confidence: T) -> Self
pub const fn new(head: Head<Q, S>, tail: Tail<Q, S>, confidence: T) -> Self
create a new LearnedRule using the given head, tail, and confidence
Sourcepub const fn from_rule(rule: Rule<Q, S>, confidence: T) -> Self
pub const fn from_rule(rule: Rule<Q, S>, confidence: T) -> Self
returns a new instance using the given rule and confidence
Sourcepub const fn from_parts(
state: Q,
symbol: S,
direction: Direction,
next_state: Q,
write_symbol: S,
confidence: T,
) -> Self
pub const fn from_parts( state: Q, symbol: S, direction: Direction, next_state: Q, write_symbol: S, confidence: T, ) -> Self
returns a new instance from its constituent parts
Sourcepub const fn confidence(&self) -> &T
pub const fn confidence(&self) -> &T
returns an immutable reference to the confidence of the rule
Sourcepub const fn confidence_mut(&mut self) -> &mut T
pub const fn confidence_mut(&mut self) -> &mut T
returns a mutable reference to the confidence of the rule
Sourcepub const fn rule_mut(&mut self) -> &mut Rule<Q, S>
pub const fn rule_mut(&mut self) -> &mut Rule<Q, S>
returns a mutable reference to the learned rule
Sourcepub fn set_confidence(&mut self, confidence: T)
pub fn set_confidence(&mut self, confidence: T)
update the confidence level of the rule
Methods from Deref<Target = Rule<Q, A>>§
Sourcepub fn tail(&self) -> &Tail<Q, A>
pub fn tail(&self) -> &Tail<Q, A>
returns an immutable reference to the Tail of the [Instruction]
Sourcepub fn head_view(&self) -> Head<&Q, &A>
pub fn head_view(&self) -> Head<&Q, &A>
returns an instance of the Head whose elements are immutable references
Sourcepub fn tail_view(&self) -> Tail<&Q, &A>
pub fn tail_view(&self) -> Tail<&Q, &A>
returns an instance of the Tail whose elements are immutable references
Sourcepub fn next_state(&self) -> &State<Q>
pub fn next_state(&self) -> &State<Q>
returns the next State of the system
Sourcepub fn next_symbol(&self) -> &A
pub fn next_symbol(&self) -> &A
returns the symbol which will be written by the Head
Sourcepub fn write_symbol(&self) -> &A
pub fn write_symbol(&self) -> &A
returns the value which for which the current object will be replaced with
Trait Implementations§
Source§impl<C: Clone, Q, S: Clone> Clone for LearnedRule<C, Q, S>
impl<C: Clone, Q, S: Clone> Clone for LearnedRule<C, Q, S>
Source§fn clone(&self) -> LearnedRule<C, Q, S>
fn clone(&self) -> LearnedRule<C, Q, S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more