本文整理匯總了Python中rule.Rule.updateStrength方法的典型用法代碼示例。如果您正苦於以下問題:Python Rule.updateStrength方法的具體用法?Python Rule.updateStrength怎麽用?Python Rule.updateStrength使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rule.Rule
的用法示例。
在下文中一共展示了Rule.updateStrength方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: proposeRule
# 需要導入模塊: from rule import Rule [as 別名]
# 或者: from rule.Rule import updateStrength [as 別名]
def proposeRule(self, facet, description, category, relation, oldCodelet):
"""Creates a proposed rule, and posts a rule-strength-tester codelet.
The new codelet has urgency a function of the degree of conceptual-depth of the descriptions in the rule
"""
from rule import Rule
rule = Rule(facet, description, category, relation)
rule.updateStrength()
if description and relation:
depths = description.conceptualDepth + relation.conceptualDepth
depths /= 200.0
urgency = math.sqrt(depths) * 100.0
else:
urgency = 0
self.newCodelet('rule-strength-tester', oldCodelet, urgency, rule)