Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Function operator error , help please !

    Posted 05/24/11 07:18 PM

    Originally posted by: chira


    Hi,

    int M=...;
    float taux_pdt_nqlte[i]=...;
    dvar boolean a[i];
    dvar boolean b[i];
    .
    .
    .
    forall ( i in I)
    (1/M) *a[i]- M*b[i]< 0.5-taux_pdt_nqlte[i];

    error " Function operator<(dexpr float,float) not available in context CPLEX.

    i don't understand why!!!!

    can you help me!

    thanks.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Function operator error , help please !

    Posted 05/25/11 12:46 AM

    Originally posted by: SystemAdmin


    Hi Chira,

    to the best of my knowledge CPLEX only supports <=, >= and ==.
    In order to model a<b you should write a<=b-eps

    Hope this helps.

    Best regards
    Norbert
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Function operator error , help please !

    Posted 05/25/11 11:39 AM

    Originally posted by: chira


    Hi trebron ;

    thanks a lot . Yes it's true Cplex only supports <=, >= and == .

    when i change < by <= , i have no error but no result !!!!
    int nbscenario=...;
    range I= 0 ..nbscenario;
    int N_0=...;
    int N_1=...;
    int N_2=...;
    int M=...;
    float taux_pdt_nqlte[I]=...;
    float taux_service[I]=...;

    dvar boolean a[I];
    dvar boolean b[I];
    dvar boolean c[I];
    dvar int N[I];
    .
    .
    .

    forall ( i in I)
    N[i]== a[i]*N_0+ b[i]*N_1+ c[i]*N_2 ;
    forall ( i in I)
    a[i]+ b[i]+c[i]== 1;
    forall ( i in I)
    (1/M)*a[i] - M*(b[i]+c[i]) <= 0.5-taux_pdt_nqlte[i] && ((1/M)*a[i]) - M*(b[i]+c[i]) <= taux_service[i]-0.5 ;
    forall ( i in I)
    ( 1/M) *b[i]- M*(a[i]+c[i]) <= 0.5-taux_pdt_nqlte[i]&& ((1/M)*b[i]) - M*(a[i]+c[i]) <= 0.5 - taux_service[i];
    forall ( i in I)
    (1/M)*b[i] - M*(a[i]+c[i]) <= taux_pdt_nqlte[i]- 0.5 && ((1/M)*b[i]) - M*(a[i]+c[i]) <= taux_service[i]- 0.5;
    forall ( i in I)
    error "
    MBean Object is not available
    MBean Object is not available

    idont't know where is the problem !!!!

    can you help me about this ?

    (1/M)*c[i] - M*(b[i]+a[i]) <= taux_pdt_nqlte[i]-0.5 && ((1/M)*c[i]) - M*(a[i]+b[i]) <= 0.5 - taux_service[i];
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Function operator error , help please !

    Posted 05/25/11 12:21 PM

    Originally posted by: SystemAdmin


    I gave a try to your code with CPLEX Studio V12.2 , using simple data I did not face any error.
    What version of CPLEX Studio are you working with?
    If you get this error with CPLEX Studio V12.2, I'd encourage you to contact IBM Support with your model and a set of data.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Function operator error , help please !

    Posted 05/25/11 05:01 PM

    Originally posted by: chira


    i'm using Cplex V12.2 but it's a trial version , perhaps with this trial version , i can't solve this problem!!!!!

    have you any idea about this !
    thanks a lot.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Function operator error , help please !

    Posted 05/31/11 01:30 PM

    Originally posted by: SystemAdmin


    Could you share your project (or a reduced version of it, cleaned of any confidential information) so I can give a try?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: Function operator error , help please !

    Posted 07/09/14 05:12 AM

    Originally posted by: ouma


    hi ,

    i'm using cplex for the first time , and i can't solve my model

    int r=2;
    range Routelist=1..r;
    int t = 2;
    range Period = 1..t;
     
    tuple routeinfo {
    int route_id;
    int facility_id;
    int Period;
    float cr;
     
    }    
    {routeinfo}Routedata=...;
    {int} facilities = { r.facility_id | r in Routedata };
     
     
     tuple route {
       int route_id;
       int facility_id;
     }    
     
     {route}Route={<k,i>|<k,i,taux,cr>in Routedata };
     
     tuple feasibleRoutes{
       int route_ID ; 
       int facility_id; 
       int taux;
     }
     {feasibleRoutes} K ={<k,i,taux> |< k,i,taux,cr> in Routedata};
     
      tuple coverageparametre {
        int route_ID;
        int customer_id;
       
      }
      {coverageparametre } Coveragedata=...; 
      
      {int} customers = { c.customer_id | c in Coveragedata };
      
      
     tuple allocinfo{
       int origin;
       int destination;
       float cost;
     }
     {allocinfo}allocdata=...;
     
     tuple allocs{ int origin; int destination;}
     {allocs }alloc ={<o,d>|<o,d,c>in allocdata};
     
     routeinfo Routes[Routelist]=[r.route_id : r | r in Routedata];
    float B[alloc]=[ <c.origin,c.destination> :c.cost | c in allocdata];
    float prixu =...;
     
     
    float Costo  [facilities][Period]=... ;
    float Costm  [facilities][Period]=... ;
    float costp  [facilities][Period]=...  ;
     
    float demandemin [customers][Period]=...;
    float demandemax [customers][Period]=...;
    float C[facilities][Period]=...;
     
    dvar boolean openf[facilities][Period]; 
    dvar boolean operf[facilities][Period];
    dvar boolean Closf[facilities][Period];
    dvar boolean Z[facilities][customers][Period];
    dvar boolean select [K];
    dvar float+ d[customers][Period];
     
    maximize 
     
    sum (i in facilities,j in customers,<i,j> in alloc, taux in Period  )(prixu* d[j][taux])-sum(t in Period ,i in facilities)(Costo[i][t]*openf[i][t]+Costm[i][t]*operf[i][t]+costp[i][t]*Closf[i][t])-sum (i in facilities,<i,j>in alloc, taux in Period) (B[<i,j>]*Z[i][j][taux])-sum (<k,i,taux> in K) Routes[K].cr * select<[k,i,taux]>;
      subject to {
      forall (i in  facilities)
                sum (j in customers, <i,j> in alloc, taux in Period) Z[i][j][taux] <= 1;
      forall (j in customers)
                sum (i in facilities, <i,j> in alloc, taux in Period) Z[i][j][taux] == 1;
      
          forall (i in facilities , j in customers, <i,j> in alloc , taux in Period , t in Period)
                Z[i][j][taux] <= openf[i][t]+operf[i][t];
                forall (i in facilities, t in Period)
                  openf[i][t]+operf[i][t]<=1; 
                
        
          forall(  i in facilities , t in Period )
          
      sum (ti in Period   ) Closf[i][ti] == 0 => openf[i][t]==1 ;
          forall(  i in facilities, t in Period ) 
      sum ( ti in Period ) openf[i][ti]==1 ||sum ( ti in Period ) operf[i][ti] ==1 => operf[i][t]==1 ;
         
          
          forall (i in facilities,j in customers, taux in Period ) 
         sum (<k,i,taux> in K, <k,j> in Coveragedata) select[<k,i,taux>] == Z[i][j][taux]; 
     
         forall(t in Period , i in facilities, taux in Period)
           sum ( j in customers)(demandemin [j][t]*Z[i][j][taux])<=   sum ( j in customers) d[j][taux];
      forall(i in facilities, t in Period, taux in Period)
         sum ( j in customers) d[j][taux]<= sum ( j in customers)(demandemax [j][taux]*Z[i][j][taux]);
         
        forall(i in facilities, t in Period, taux in Period)
         sum ( j in customers) d[j][taux]<=  C[i][t]*(openf[i][t]+operf[i][t]);
         
      
          forall  (i in facilities,t in Period) 
          openf[i][t]==0|| openf[i][t]==1; 
          forall  (i in facilities,t in Period) 
          operf[i][t]==0|| operf[i][t]==1; 
           forall  (i in facilities,t in Period) 
          Closf[i][t]==0|| Closf[i][t]==1; 
          
          forall  (i in facilities,j in customers, taux in Period) 
          Z[i][j][taux]==0|| Z[i][j][taux]==1; 
         
          
          }

     

    have you any idea about this ?

     

    thanks a lot 

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: Function operator error , help please !

    Posted 07/09/14 05:35 AM

    Originally posted by: StephenHall


    The reason that CPLEX does not support "<" or ">" with "float" is how to define the float are not equal.

    therefore you need to tell the model what do you consider as not equal with 

    a<=b-eps, where eps is the minal distance betwen 2 float.

    Note that with integer "<" ans ">" works

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer