亲爱的,我在 python 中使用 CP-SAT。我有两个变量:
pippo = model.NewIntVar(-93372036854775808,9123372036854775807, 'pippo')
test = model.NewIntVar(-93372036854775808,9123372036854775807, 'test')
以及以下决策变量:
for r in self.all_records:
memory = {}
for p in self.all_decisions:
# create bool decision variables
memory[p] = model.NewBoolVar('c' + str(r) + self.scenario.decisions[p].name)
self.decision_var[r] = memory
我有两个限制:
1) test==sum(self.scenario.dataset['is_fraud'][r]*self.decision_var[r][0] for r in self.all_records)
2) pippo == test
如果我删除约束 2) 一切正常,但使用约束 2 我会收到此错误:
Possible integer overflow in constraint: linear {
vars: 126660
vars: 126661
coeffs: -1
coeffs: 1
domain: 0
domain: 0
}
and Status is MODEL_INVALID.
我真的不明白为什么。请问你能帮帮我吗?