def addVar (self, ve):
assert(isinstance(ve, tft_expr.VariableExpr))
vlabel = ve.label()
vtype = ve.type()
lb = None
if (ve.hasLB()):
lb = ve.lb().value()
ub = None
if (ve.hasUB()):
ub = ve.ub().value()
assert(vtype in [int, float, Fraction])
if (vlabel not in self.variables.keys()):
self.variables[vlabel] = [vtype, lb, ub]
else:
assert(vtype is self.variables[vlabel][0])
assert(lb is self.variables[vlabel][1])
assert(ub is self.variables[vlabel][2])
评论列表
文章目录