I have the following decision boolean variables x[t] and w[t], and an auxiliary variable p[t].
p[t] = p[t - 1] + w[t] * constant
p[t] <= Max Value
But I have also a condition where if x[t - 1] == 1 then p[t] will reset to 0.
I'm using OnlyEnforceIf as following:
model.Add(self.p[e, t] == 0).OnlyEnforceIf(x[e, t - 1] == 1)
But I am getting the following error
'Constraint' object has no attribute 'OnlyEnforceIf'
as documented on this doc on channeling.