Assuming that you are trying to enforce the constraint that for each value of t there exists a value of w such that Assign[t][s][w] is 1 for at least one value of s, you could do it in CPLEX as follows. Add a continuous variable y[t][w] with domain [0,1]. For each combination of t and w, add the constraint y[t][w] <= sum(s in SVES) Assign[t][s][w]. Finally, for each t add the constraint sum(w in Servers) y[t][w] >= 1.
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
------------------------------
Original Message:
Sent: Wed September 22, 2021 06:38 AM
From: Olga Chukhno
Subject: number of active nodes as a constraint
Hello!
I need to use the number of active nodes as a constraint.
The following expression works well:
dexpr float AS[t in Slots]= (sum(w in Servers) ((sum(s in SVES) Assign[t][s][w]) >=1));
Here, Assign is a boolean variable.
However, when I try to do the following as a constraint:
//forall (t in Slots) 1/(sum(w in Servers) ((sum(s in SVES) Assign[t][s][w]) >=1))<=1;
it returns me an error.:
CPLEX(default) cannot extract expression
How can I overcome this situation?
------------------------------
Best regards,
Olga
------------------------------
#DecisionOptimization