pub struct TermLink { /* private fields */ }Expand description
词项链
§📄OpenNARS
A link between a compound term and a component term
A TermLink links the current Term to a target Term, which is either a component of, or compound made from, the current term.///
Neither of the two terms contain variable shared with other terms.///
The index value(s) indicates the location of the component in the compound.///
This class is mainly used in inference.RuleTable to dispatch premises to inference rules
Implementations§
Source§impl TermLink
impl TermLink
pub fn from_template( target: Term, template: &TermLinkTemplate, budget: BudgetValue, ) -> Self
Trait Implementations§
Source§impl Budget for TermLink
impl Budget for TermLink
Source§fn priority(&self) -> ShortFloat
fn priority(&self) -> ShortFloat
模拟
BudgetValue.getPriority Read moreSource§fn __priority_mut(&mut self) -> &mut ShortFloat
fn __priority_mut(&mut self) -> &mut ShortFloat
获取优先级(可变) Read more
Source§fn durability(&self) -> ShortFloat
fn durability(&self) -> ShortFloat
模拟
BudgetValue.getDurability Read moreSource§fn __durability_mut(&mut self) -> &mut ShortFloat
fn __durability_mut(&mut self) -> &mut ShortFloat
获取耐久度(可变) Read more
Source§fn quality(&self) -> ShortFloat
fn quality(&self) -> ShortFloat
模拟
BudgetValue.getQuality Read moreSource§fn __quality_mut(&mut self) -> &mut ShortFloat
fn __quality_mut(&mut self) -> &mut ShortFloat
获取质量(可变) Read more
Source§fn set_priority(&mut self, new_p: ShortFloat)
fn set_priority(&mut self, new_p: ShortFloat)
设置优先级 Read more
Source§fn set_durability(&mut self, new_d: ShortFloat)
fn set_durability(&mut self, new_d: ShortFloat)
设置耐久度 Read more
Source§fn set_quality(&mut self, new_q: ShortFloat)
fn set_quality(&mut self, new_q: ShortFloat)
设置质量 Read more
Source§fn copy_budget_from(&mut self, from: &impl Budget)
fn copy_budget_from(&mut self, from: &impl Budget)
🆕从其它预算值处拷贝值 Read more
Source§fn budget_summary(&self) -> ShortFloat
fn budget_summary(&self) -> ShortFloat
模拟
BudgetValue.summary Read moreSource§fn budget_above_threshold(&self, budget_threshold: Float) -> bool
fn budget_above_threshold(&self, budget_threshold: Float) -> bool
模拟
BudgetValue.aboveThreshold Read moreSource§fn budget_to_display(&self) -> String
fn budget_to_display(&self) -> String
模拟
toString Read moreSource§fn budget_to_display_brief(&self) -> String
fn budget_to_display_brief(&self) -> String
模拟
toStringBrief Read moreSource§fn budget_to_lexical(&self) -> LexicalBudget
fn budget_to_lexical(&self) -> LexicalBudget
🆕转换为「词法真值」 Read more
Source§impl<'de> Deserialize<'de> for TermLink
impl<'de> Deserialize<'de> for TermLink
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
impl Eq for TermLink
impl StructuralPartialEq for TermLink
Auto Trait Implementations§
impl Freeze for TermLink
impl RefUnwindSafe for TermLink
impl Send for TermLink
impl Sync for TermLink
impl Unpin for TermLink
impl UnsafeUnpin for TermLink
impl UnwindSafe for TermLink
Blanket Implementations§
Source§impl<T> BoostWithOption for T
impl<T> BoostWithOption for T
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
Source§impl<B> BudgetFunctions for Bwhere
B: Budget,
impl<B> BudgetFunctions for Bwhere
B: Budget,
Source§fn truth_to_quality(truth: &impl Truth) -> ShortFloat
fn truth_to_quality(truth: &impl Truth) -> ShortFloat
模拟
BudgetFunctions.truthToQuality Read morefn truth_to_quality_float(truth: &impl Truth) -> Float
Source§fn concept_total_quality(concept: &Concept) -> ShortFloat
fn concept_total_quality(concept: &Concept) -> ShortFloat
概念的「总体优先级」 Read more
Source§fn solution_quality(
query: &impl Sentence,
solution: &impl Judgement,
) -> ShortFloat
fn solution_quality( query: &impl Sentence, solution: &impl Judgement, ) -> ShortFloat
📄OpenNARS Read more
Source§fn solution_eval(
problem: &impl Question,
solution: &impl Judgement,
question_task_budget: &impl Budget,
) -> BudgetValue
fn solution_eval( problem: &impl Question, solution: &impl Judgement, question_task_budget: &impl Budget, ) -> BudgetValue
模拟
BudgetFunctions.solutionEval Read moreSource§fn revise(
new_belief_truth: &impl Truth,
old_belief_truth: &impl Truth,
revised_truth: &impl Truth,
current_task_budget: &impl Budget,
current_links_budget: Option<(&impl Budget, &impl Budget)>,
) -> ReviseResult
fn revise( new_belief_truth: &impl Truth, old_belief_truth: &impl Truth, revised_truth: &impl Truth, current_task_budget: &impl Budget, current_links_budget: Option<(&impl Budget, &impl Budget)>, ) -> ReviseResult
统一的「修正规则」预算函数 Read more
Source§fn update(
task_truth: &impl Truth,
task_budget: &mut Self,
b_truth: &impl Truth,
) -> BudgetValue
fn update( task_truth: &impl Truth, task_budget: &mut Self, b_truth: &impl Truth, ) -> BudgetValue
模拟
BudgetFunctions.update Read moreSource§fn distribute_among_links(&self, n: usize) -> BudgetValue
fn distribute_among_links(&self, n: usize) -> BudgetValue
模拟
BudgetFunctions.distributeAmongLinks Read moreSource§fn activate_to_concept(&self, concept: &Concept) -> BudgetValue
fn activate_to_concept(&self, concept: &Concept) -> BudgetValue
模拟
BudgetFunctions.activate Read moreSource§fn forget(&self, forget_rate: Float, relative_threshold: Float) -> Float
fn forget(&self, forget_rate: Float, relative_threshold: Float) -> Float
模拟
BudgetFunctions.forget Read moreSource§fn merge(&self, other: &impl Budget) -> BudgetValue
fn merge(&self, other: &impl Budget) -> BudgetValue
Source§fn forward(
truth: Option<&impl Truth>,
content: Option<&Term>,
) -> BudgetInferenceParameters
fn forward( truth: Option<&impl Truth>, content: Option<&Term>, ) -> BudgetInferenceParameters
Forward inference result and adjustment
Source§fn backward(
truth: Option<&impl Truth>,
content: Option<&Term>,
) -> BudgetInferenceParameters
fn backward( truth: Option<&impl Truth>, content: Option<&Term>, ) -> BudgetInferenceParameters
Backward inference result and adjustment, stronger case
Source§fn backward_weak(
truth: Option<&impl Truth>,
content: Option<&Term>,
) -> BudgetInferenceParameters
fn backward_weak( truth: Option<&impl Truth>, content: Option<&Term>, ) -> BudgetInferenceParameters
Backward inference result and adjustment, weaker case
Source§fn compound_forward(
truth: Option<&impl Truth>,
content: Option<&Term>,
) -> BudgetInferenceParameters
fn compound_forward( truth: Option<&impl Truth>, content: Option<&Term>, ) -> BudgetInferenceParameters
Forward inference with CompoundTerm conclusion
Source§fn compound_backward(
truth: Option<&impl Truth>,
content: Option<&Term>,
) -> BudgetInferenceParameters
fn compound_backward( truth: Option<&impl Truth>, content: Option<&Term>, ) -> BudgetInferenceParameters
Backward inference with CompoundTerm conclusion, stronger case
Source§fn compound_backward_weak(
truth: Option<&impl Truth>,
content: Option<&Term>,
) -> BudgetInferenceParameters
fn compound_backward_weak( truth: Option<&impl Truth>, content: Option<&Term>, ) -> BudgetInferenceParameters
Backward inference with CompoundTerm conclusion, weaker case
Source§fn budget_inference_function_from<T: Truth>(
function_enum: BudgetInferenceFunction,
) -> BudgetInferenceF<T>
fn budget_inference_function_from<T: Truth>( function_enum: BudgetInferenceFunction, ) -> BudgetInferenceF<T>
从「预算推理函数 枚举」到「预算推理函数指针」
Source§fn budget_inference<T: Truth>(
function: BudgetInferenceFunction,
truth: Option<&T>,
content: Option<&Term>,
task_link_budget: &impl Budget,
belief_link_budget: Option<&impl Budget>,
target_activation: ShortFloat,
) -> BudgetInferenceResult
fn budget_inference<T: Truth>( function: BudgetInferenceFunction, truth: Option<&T>, content: Option<&Term>, task_link_budget: &impl Budget, belief_link_budget: Option<&impl Budget>, target_activation: ShortFloat, ) -> BudgetInferenceResult
Common processing for all inference step Read more
Source§impl<B> BudgetInference for Bwhere
B: Budget,
impl<B> BudgetInference for Bwhere
B: Budget,
Source§fn merge_from(&mut self, other: &impl Budget)where
Self: Sized,
fn merge_from(&mut self, other: &impl Budget)where
Self: Sized,
Source§fn revise_direct(
new_belief_truth: &impl Truth,
old_belief_truth: &impl Truth,
revised_truth: &impl Truth,
current_task_budget: &mut impl Budget,
) -> BudgetValue
fn revise_direct( new_belief_truth: &impl Truth, old_belief_truth: &impl Truth, revised_truth: &impl Truth, current_task_budget: &mut impl Budget, ) -> BudgetValue
修正@直接推理 Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> JoinTo for T
impl<T> JoinTo for T
Source§fn join_to<S>(self, out: &mut String, sep: impl AsRef<str>)
fn join_to<S>(self, out: &mut String, sep: impl AsRef<str>)
将字串集中拼接到一个「目标字串」中,中途不创建任何辅助字符串 Read more
Source§impl<T> JoinTo for T
impl<T> JoinTo for T
Source§fn join_to<S>(self, out: &mut String, sep: impl AsRef<str>)
fn join_to<S>(self, out: &mut String, sep: impl AsRef<str>)
将字串集中拼接到一个「目标字串」中,中途不创建任何辅助字符串 Read more