Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Cplex OPL messy code error

    Posted 11/01/16 11:00 AM

    Originally posted by: flgkd


    Hi,

    I used IBM ILOG CPLEX Optimization Studio to run a  problem, but got an error with messy code. The file editor didn't alert any errors until I pushed the run button.

    The error is:

    
    ÔËÐÐÅäÖá°option 1¡±²»´æÔڡ£          unknown OPL
    
    

    As such an error, I really don't know how to fix it. Here is the .mod and .dat file.

    .mod file

     .dat file

    Do my codes have any mistakes? Or it is the reason that my cplex is Promotional version which limits at most 1000 constraints?

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Cplex OPL messy code error

    Posted 11/01/16 02:31 PM

    Hi,

    can you attach .mod and .dat ?

    Which cplex version do you use ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Cplex OPL messy code error

    Posted 11/01/16 09:12 PM

    Originally posted by: flgkd


    Hi,  first thank you for your attention.

    The .mod file is:

    int n=...;
    float D[1..n][1..n]=...;
    int H[1..n][1..n]=...;
    float Delay_trans=...;
    float Bandwidth_trans=...;
    {string} SFC1={"Ingress","Firewall","PGW","Proxy","Egress"};
    float SFC1_DR=...;
    int m=card(SFC1);
    dvar boolean sfc1[1..m][1..n];
    minimize
    sum(i in 1..m-1,j in 1..n,k in 1..n)sfc1[i][j]*sfc1[i+1][k]*D[j][k]*SFC1_DR*Delay_trans
    +sum(i in 1..m-1,j in 1..n,k in 1..n)sfc1[i][j]*sfc1[i+1][k]*H[j][k]*SFC1_DR*Bandwidth_trans;

    subject to{
    sfc1[1][1]==1;
    sfc1[m][n]==1;
    forall(i in 2..n)
      sfc1[1][i]==0;
    forall(i in 1..n-1)
      sfc1[m][i]==0;
    forall(i in 2..m-1)
      sfc1[i][1]==0;
    forall(i in 2..m-1)
      sfc1[i][n]==0;

    forall(i in 2..m-1)
      sum(j in 2..n)sfc1[i][j]==1;
    forall(i in 2..n-1)
      sum(j in 2..m-1 )sfc1[j][i]<=1;
    }

     

    The  .dat file is:

    n=6;
    D=[
        [0    20    15    50    45    55],
        [20     0    10    30    25    35],
        [15    10     0    40    30    40],
        [50    30    40     0    20    15],
        [45    25    30    20     0    10],
        [55    35    40    15    10     0],
    ];
    H=[
         [0     1     1     2     2     3],
         [1     0     1     1     1     2],
         [1     1     0     2     1     2],
         [2     1     2     0     1     1],
         [2     1     1     1     0     1],
         [3     2     2     1     1     0],
    ];
    Delay_trans=1.0;
    Bandwidth_trans=1.0;

    SFC1_DR=1.0;

     

    My CPLEX is the trial version of IBM ILOG CPLEX Optimization Studio V12.6.3 .


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Cplex OPL messy code error

    Posted 11/02/16 04:03 PM

    Hi,

    on my machine with CPLEX 12.6.3 your model works fine.

    I am not sure your instal worked well. Have you managed to run other models ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Cplex OPL messy code error

    Posted 11/03/16 04:05 AM

    Originally posted by: flgkd


    Hi,

    I have finally found the reason of messy code error.

    The reason is I  named the  Run Configuration file with Chinese characters.

    Now the model works fine.

    Thanks a lot for your help.

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer