код cplex opl:
Код: Выделить всё
int V = 5;
int C = 2;
int T = 10;
float p[1..C][1..T] = ...;
float Eq[1..V] = [50,30,25,32,35];
dvar boolean x[1..V][1..C][1..T];
dvar float+ dmnd[1..V][1..T];
dexpr float load[c in 1..C][t in 1..T] = sum(e in 1..V) dmnd[e][t] * x[e][c][t];
minimize
sum(e in 1..V, c in 1..C, t in 1..T)
p[c][t] * dmnd[e][t] * x[e][c][t];
subject to {
forall(e in 1..V, t in 1..T)
sum(c in 1..C) x[e][c][t]
Подробнее здесь: [url]https://stackoverflow.com/questions/79881848/why-does-the-python-script-return-0-for-opl-variables-that-are-non-zero-in-the-c[/url]
Мобильная версия