代码语言:javascript复制
1 from sys import stderr
2 #########################
3 TRUE = 1 #定义返回值
4 FALSE = 0
5 FACT_LENGTH = 9 #'''前提与结论总数'''
6 PRMS_LENGTH = 2 #'''每条规则的前提个数'''
7 PREMISE = 7 #'''前提数量'''
8 RULE_LENGTH = 4 #'''规则数量'''
9 LIMIT = 0.5 #'''结论阈值'''
10 AND = 1 #'''规则前提逻辑关系'''
11 OR = 0
12 VH = 0.9 #'''规则前提可信度初始化'''
13 H = 0.7
14 M = 0.5
15 #double Rule_CF[RULE_LENGTH]
16 Rule_CF = [0.0]*(RULE_LENGTH 1)
17 Str = ["E1", "E2", "E3", "E4", "E5",
18 "E6", "E7", "H1", "H", "