Originally posted by: Matthew Tsang
Hello,
I have made the following if-then constraint to my objective function. The constraint aims to keep S1, a binary decision variable, to stay on the same value for 2 continuous iterations throughout the run. However, cplex does not allow a decision variable to be involved in such a circumstance (possibly in a if-then statement). I wonder if there is any alternative way to code this.
Thank you for your time in advnace!
forall(t in 3..NumIteration)
{
if(S1[t-2] != S1[t-1])
{
S1[t] == S1[t-1];
}
}
#CPLEXOptimizers#DecisionOptimization