Skip to main content

TermLink

Struct TermLink 

Source
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

pub fn from_template( target: Term, template: &TermLinkTemplate, budget: BudgetValue, ) -> Self

Trait Implementations§

Source§

fn priority(&self) -> ShortFloat

模拟BudgetValue.getPriority Read more
Source§

fn __priority_mut(&mut self) -> &mut ShortFloat

获取优先级(可变) Read more
Source§

fn durability(&self) -> ShortFloat

模拟BudgetValue.getDurability Read more
Source§

fn __durability_mut(&mut self) -> &mut ShortFloat

获取耐久度(可变) Read more
Source§

fn quality(&self) -> ShortFloat

模拟BudgetValue.getQuality Read more
Source§

fn __quality_mut(&mut self) -> &mut ShortFloat

获取质量(可变) Read more
Source§

fn set_priority(&mut self, new_p: ShortFloat)

设置优先级 Read more
Source§

fn set_durability(&mut self, new_d: ShortFloat)

设置耐久度 Read more
Source§

fn set_quality(&mut self, new_q: ShortFloat)

设置质量 Read more
Source§

fn pdq(&self) -> [ShortFloat; 3]

🆕获取「优先级,耐久度,质量」三元组 Read more
Source§

fn pdq_float(&self) -> [Float; 3]

🆕获取「优先级,耐久度,质量」三元组 Read more
Source§

fn copy_budget_from(&mut self, from: &impl Budget)

🆕从其它预算值处拷贝值 Read more
Source§

fn budget_summary(&self) -> ShortFloat

模拟BudgetValue.summary Read more
Source§

fn budget_above_threshold(&self, budget_threshold: Float) -> bool

模拟 BudgetValue.aboveThreshold Read more
Source§

fn budget_to_display(&self) -> String

模拟toString Read more
Source§

fn budget_to_display_brief(&self) -> String

模拟toStringBrief Read more
Source§

fn budget_to_lexical(&self) -> LexicalBudget

🆕转换为「词法真值」 Read more
Source§

fn clone(&self) -> TermLink

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

fn key(&self) -> &String

获取其元素id Read more
Source§

fn merge_order(&self, _new: &Self) -> MergeOrder

🆕决定「袋」中俩Item的合并顺序 Read more
Source§

fn eq(&self, other: &TermLink) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

fn target<'r, 's: 'r>(&'s self) -> impl Deref<Target = Term> + 'r

链接所指目标 Read more
Source§

fn target_mut<'r, 's: 'r>(&'s mut self) -> impl DerefMut<Target = Term> + 'r

目标的可变引用 Read more
链接类型 Read more
Source§

fn indexes(&self) -> &[usize]

获取链接的「索引」,指向具体词项的位置 Read more
Source§

fn generate_key_base(link_type: TLinkType, indexes: &[usize]) -> String

Set the key of the link Read more
Source§

fn get_index(&self, index: usize) -> Option<&usize>

Get one index by level
Source§

fn index(&self, index: usize) -> usize

快速假定性获取索引 Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> BoostWithOption for T

Source§

fn option<C>(self, criterion: C) -> Option<Self>
where C: FnOnce(&Self) -> bool,

根据某条件把自身变为可选值 Read more
Source§

fn some(self) -> Option<Self>

将自身封装为Some Read more
Source§

fn none(self) -> Option<Self>

将自身封装为None Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<B> BudgetFunctions for B
where B: Budget,

Source§

fn truth_to_quality(truth: &impl Truth) -> ShortFloat

模拟BudgetFunctions.truthToQuality Read more
Source§

fn truth_to_quality_float(truth: &impl Truth) -> Float

Source§

fn rank_belief(judgement: &impl Judgement) -> Float

模拟BudgetFunctions.rankBelief Read more
Source§

fn concept_total_quality(concept: &Concept) -> ShortFloat

概念的「总体优先级」 Read more
Source§

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

模拟BudgetFunctions.solutionEval Read more
Source§

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

模拟BudgetFunctions.update Read more
模拟BudgetFunctions.distributeAmongLinks Read more
Source§

fn activate_to_concept(&self, concept: &Concept) -> BudgetValue

模拟BudgetFunctions.activate Read more
Source§

fn forget(&self, forget_rate: Float, relative_threshold: Float) -> Float

模拟BudgetFunctions.forget Read more
Source§

fn merge(&self, other: &impl Budget) -> BudgetValue

模拟BudgetValue.merge,亦与BudgetFunctions.merge相同 Read more
Source§

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

Backward inference result and adjustment, stronger case
Source§

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

Forward inference with CompoundTerm conclusion
Source§

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

Backward inference with CompoundTerm conclusion, weaker case
Source§

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

Common processing for all inference step Read more
Source§

impl<B> BudgetInference for B
where B: Budget,

Source§

fn merge_from(&mut self, other: &impl Budget)
where Self: Sized,

🆕模拟BudgetValue.merge,亦与BudgetInference.merge相同 Read more
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

修正@直接推理 Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> JoinTo for T

Source§

fn join_to<S>(self, out: &mut String, sep: impl AsRef<str>)
where Self: Sized + Iterator<Item = S>, S: AsRef<str>,

将字串集中拼接到一个「目标字串」中,中途不创建任何辅助字符串 Read more
Source§

fn join_to_new<S>(self, sep: impl AsRef<str>) -> String
where Self: Sized + Iterator<Item = S>, S: AsRef<str>,

将字串集中拼接到一个新字串中 Read more
Source§

fn join_to_multi<S>(self, out: &mut String, sep: &[impl AsRef<str>])
where Self: Sized + Iterator<Item = S>, S: AsRef<str>,

将字串集中拼接到一个「目标字串」中,使用多个分隔符,中途不创建任何辅助字符串 Read more
Source§

fn join_to_multi_new<S>(self, sep: &[impl AsRef<str>]) -> String
where Self: Sized + Iterator<Item = S>, S: AsRef<str>,

将字串集中拼接到一个新字串中,使用多个分隔符 Read more
Source§

impl<T> JoinTo for T

Source§

fn join_to<S>(self, out: &mut String, sep: impl AsRef<str>)
where Self: Sized + Iterator<Item = S>, S: AsRef<str>,

将字串集中拼接到一个「目标字串」中,中途不创建任何辅助字符串 Read more
Source§

fn join_to_new<S>(self, sep: impl AsRef<str>) -> String
where Self: Sized + Iterator<Item = S>, S: AsRef<str>,

将字串集中拼接到一个新字串中 Read more
Source§

fn join_to_multi<S>(self, out: &mut String, sep: &[impl AsRef<str>])
where Self: Sized + Iterator<Item = S>, S: AsRef<str>,

将字串集中拼接到一个「目标字串」中,使用多个分隔符,中途不创建任何辅助字符串 Read more
Source§

fn join_to_multi_new<S>(self, sep: &[impl AsRef<str>]) -> String
where Self: Sized + Iterator<Item = S>, S: AsRef<str>,

将字串集中拼接到一个新字串中,使用多个分隔符 Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToDebug for T
where T: Debug,

Source§

fn to_debug(&self) -> String

将对象转换为「用Debug格式化的字符串」

Source§

impl<T> ToDebug for T
where T: Debug,

Source§

fn to_debug(&self) -> String

将对象转换为「用Debug格式化的字符串」

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Void for T

Source§

fn void(self)

Source§

impl<T> Void for T

Source§

fn void(self)