Topic
  • 1 reply
  • Latest Post - ‏2012-11-12T22:22:38Z by SystemAdmin
SystemAdmin
SystemAdmin
1883 Posts

Pinned topic Cplex(default) cannot extract expression

‏2012-11-12T17:50:26Z |
Hi, I am new here and I am getting an error. The code is:
int nbNodes = ...;
int nbSlots = ...;

range Nodes = 1..nbNodes;
range Slots = 1..nbSlots;

//Demands and paths

tuple demand {int source; int destination; int bd; int nd;}
setof(demand) Demands = ...;

tuple tpath{int pathNodes;}
{tpath} P =...;

setof(tpath) PathsDemands=...;

tuple tchannel {int channelSlots;}
setof(tchannel) C = ...;
setof(tchannel) ChannelsDemands=...;

tuple tlink {int linkhttp://1..2;}
setof(tlink) E = ...;

tuple slot {int i;}
{slot} S = ...;

//decision variables

dvar boolean deltape[P][E];
dvar boolean gamacs[C]Slots;
dvar boolean xdDemands;
dvar boolean ypc[P][C];

minimize sum (d in Demands) xd[d]*d.bd;

subject to{

forall(d in Demands)
sum (p in Paths[d])
sum(c in Channels[d])
ypc[p][c] + xd[d] == 1;

forall(e in E, s in Slots) //error
sum (d in Demands)
sum (p in Paths[d])
sum (c in Channels[d])
deltape[p][e]*ypc[p][c]*gamacs[c][s] <= 1;

};

I suspect the error is related with the third degree term, but I don't know how to solve. Can anyone help me?
Updated on 2012-11-12T22:22:38Z at 2012-11-12T22:22:38Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1883 Posts

    Re: Cplex(default) cannot extract expression

    ‏2012-11-12T22:22:38Z  
    How can I rewrite this third degree term?