答案 0 :(得分:0)
假设存储在表中的以下用户定义规则:
def listToString(list):
length = len(list)
if length == 0 :
return ""
elif length == 1 :
return "{}".format(list[0])
else:
strings = ["{}".format(x) for x in list[:-1]]
return "{} and {}".format(", ".join(strings), list[-1])
让我们说在事件X = 10之前,Y = 12。 事件= A,ocuuurance = 1,keep-old-x = T,keep-old-y = F,x-frequency = 1,y-frequency = 100
-----------------------------------------------------------------
|eventid|occurance|keep-old-x|keep-old-y|x-frequency|y-frequency|
-----------------------------------------------------------------
| A | 1 | T | F | 1 | 100 |
-----------------------------------------------------------------
| B | 2 | F | T | -2 | 0 |
-----------------------------------------------------------------
| C | 5 | T | T | 100 | -3 |
-----------------------------------------------------------------
现在,X = 11,Y = 100
您可能需要再添加两列来更改特定值的X变量值;为:
if keep-old-x is T then
X = X + x-frequency
else
X = x-frequency
endif
if keep-old-y is T then
Y = Y + y-frequency
else
Y = y-frequency
endif
我希望这会有所帮助。