Originally posted by: meletis13forever
Hello,
I have a problem with my model:
{string} terminal =...;
{string} macroBS =...;
{string} femto =...;
tuple coordinates{
int x;
int y;
}
coordinates posBS_femto
macroBS union femto =...;
int covBS =...;
int cap
macroBS union femto =...;
float power
femto=...;
int NbPL=...;
range PL = 0..NbPL-1;
float l
PL=...;
int NbBL=...;
range BL = 0..NbBL-1;
int BW
BL =...;
int maxBW
terminal =...;
tuple positionterminal{
int xter;
int yter;
}
positionterminal posterminal
terminal;
positionterminal dummy;
execute{
for(var t in terminal){
dummy.xter=100000;
dummy.yter=100000;
while((posBS_femto.x-dummy.xter)^2 + (posBS_femto.y-dummy.yter)^2 >= covBS){
dummy.xter=875+Opl.rand(30);
dummy.yter=268+Opl.rand(30);
//writeln("testing- xter="+dummy.xter + ";yter="+dummy.yter);
}
posterminal[t]=dummy;
writeln("success adding - posterminal="+posterminal[t]);
}
writeln("posterminal="+posterminal);
}
dvar boolean x
terminalmacroBS union femto;
dvar boolean y
PLfemto;
dvar boolean N
terminalfemtoPL;
dvar int b
terminal;
dexpr float Cp
PLj in femto = sum(k in PL) y[k][j] * l[k] * power[j];
dexpr float cov
j in femtok in PL = 10^((Cp[k][j]/20) + 1.96);
dexpr float d
i in terminalj in macroBS union femto = sqrt((posterminal[i].xter - posBS_femto[j].x)^2 + (posterminal[i].yter - posBS_femto[j].y)^2);
dexpr int load
j in macroBS union femto = sum(i in terminal) x[i][j] * b[i] ;
minimize
sum(j in femto, k in PL) Cp[k][j] +
sum(i in terminal, j in femto, i2 in terminal : i2!=i, j2 in femto : j2!=j) (x[i][j] - x
i2j2) +
sum(i in terminal, j in macroBS union femto) x[i][j] * d[i][j];
subject to{
forall(i in terminal)
sum(j in macroBS union femto)
x[i][j] == 1;
forall(j in femto)
sum(k in PL)
y[k][j] == 1;
forall(i in terminal, j in femto, k in PL)
N[i][j][k] <= y[k][j];
forall(i in terminal, j in femto, k in PL)
x[i][j] <= N[i][j][k] * y[k][j];
forall(i in terminal)
b[i] <= maxBW[i];
forall(j in macroBS union femto)
load[j] <= cap[j];
forall(i in terminal)
b[i] == 64 || b[i] == 128 || b[i] == 256 || b[i] == 384 || b[i] == 512 || b[i] ==1024;
}
execute{
writeln(load);
}
In the problem browser I see CPLEX Error 5002: Q in 'id3585' is not positive semi-definite.
This is caused by the constraint in the subject block
forall(j in macroBS union femto)
load[j] <= cap[j];
The load is dexpr and I don't know why this is happening. Can you help me? The capacity (cap) is defined in the data.
#DecisionOptimization#MathematicalProgramming-General