本文整理匯總了Python中rule.Rule.header方法的典型用法代碼示例。如果您正苦於以下問題:Python Rule.header方法的具體用法?Python Rule.header怎麽用?Python Rule.header使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rule.Rule
的用法示例。
在下文中一共展示了Rule.header方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: generate_rules
# 需要導入模塊: from rule import Rule [as 別名]
# 或者: from rule.Rule import header [as 別名]
def generate_rules(self):
""""""
for reaction_container in self.reaction_pool:
rule_container = RuleContainer(reaction_container)
rule_container.sp_state = reaction_container.sp_state
common_cont = reaction_container.get_common_contingencies()
rule_container.common_reqs = common_cont
if self.contingency_pool.has_key(reaction_container.name):
gen = RequirementsGenerator(self.contingency_pool[reaction_container.name])
rule_container.contingencies = gen
else:
rule_container.contingencies = None
# add source and product states and reqs change name.
header = True if len(reaction_container) > 1 else False
for reaction in reaction_container:
rule = Rule(reaction)
rule.header = header
# add specific reqs and cont.
rule_container.add_rule(rule)
if header:
rule.specific_reqs = reaction.get_specific_contingencies(common_cont)
self.rule_pool[reaction_container.name] = rule_container