Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2013-08-11T23:59:30Z by PaulRubin
Puppy26
Puppy26
4 Posts
ACCEPTED ANSWER

Pinned topic Decision Variable Not Allowed Error

‏2013-08-11T20:08:47Z |

Dear all,

I'm a new user of CPLEX for my thesis work. I'm constantly getting an error as Decision Variable (expression) not allowed.

I'm getting some error as "Decision variable (expression) "Open" not allowed". If I remove the open parameter from the code, again I'm getting error as "CTSupply" not allowed.

For your reference, I have the code of the project. 

 

 

float Fixed = ...;
float Revenue = ...;
float ECDemanded = ...;
float TSCFixed = ...;
float DSCFixed = ...;
float DSCost = ...;
float ISTerminal = ...;
float ISDepot = ...;
{string} Terminals = ...;
{string} Depots = ...;
int NbShippers = ...;
int NbConsignees = ...;
range Shippers = 0..NbShippers-1;
range Consignees = 0..NbConsignees-1;
float Capacity[Depots] = ...;
float ConsigneesCost[Depots][Consignees] = ...;
float ShippersCost[Shippers][Depots] = ...;
float ConstoTerminCost[Terminals][Consignees] = ...;
float TermfloatoDepotCost[Depots][Terminals] = ...;
float DepottoTerminCost[Terminals][Depots] = ...;
float DepottoDepotCost [Depots][Depots] = ...;
float STCcost [Shippers][Consignees] = ...;
  dvar boolean CTSupply;
  dvar boolean DSSupply;
  dvar boolean CDSupply;
  dvar boolean STSupply;
  dvar boolean TDSupply;
  dvar boolean DTSupply;
  dvar boolean DDSupply;
dvar boolean Open[Depots];
float RG = Revenue * ECDemanded;
float TC =  sum( d in Depots ) 
    Fixed * Open[d] + sum (c in Consignees, t in Terminals) 
ConstoTerminCost [t][c] * CTSupply + 
 sum (d in Depots, c in Consignees) ConsigneesCost [d][c] * CDSupply + 
 sum (s in Shippers, c in Consignees) STCcost [s][c] * (0.15 * ECDemanded) + 
 sum (s in Shippers, d in Depots) ShippersCost [s][d] * DSSupply + 
 sum (d in Depots, t in Terminals) TermfloatoDepotCost [d][t] * TDSupply +
 sum (t in Terminals, d in Depots) DepottoTerminCost [t][d] * DTSupply + 
 sum (t in Terminals) TSCFixed * (ISTerminal + CTSupply + DTSupply - TDSupply) + 
 sum (d in Depots) DSCFixed * (ISDepot + CDSupply + TDSupply - DSSupply - DTSupply - DDSupply) + 
 sum( d in Depots) DepottoDepotCost[d][d] * DDSupply;
    
float Max = RG - TC ;
 
subject to
{
   forall (d in Depots)
     ctEachDepotHasOneConsignee:
       sum (c in Consignees)
         CDSupply ==1;
         
   forall (s in Shippers)
      ctEachShipperHasOneDepot:
        sum (d in Depots)
          DSSupply ==1;
          
   forall (d in Depots)
     ctUseOpenDepots:
       sum (d in Depots) DDSupply + sum (d in Depots) CDSupply  <= Open [d] * Capacity [d];       
}        
 
 Please do help me. 

Attachments

  • PaulRubin
    PaulRubin
    48 Posts
    ACCEPTED ANSWER

    Re: Decision Variable Not Allowed Error

    ‏2013-08-11T23:59:30Z  in response to Puppy26

    This is cross-posted on the CPLEX forum. Don't know if it's been posted to the OPL forum (where it would have the best chance of receiving an answer) yet.