Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Error: Unexpected value in .dat file

    Posted 09/18/17 10:28 AM

    Originally posted by: gustavgans123


    Hi,

    I am new to CPLEX studio and I have a problem with the model that I built.

    When I run the configuration, I get the error: "Data entry "xx" was not expected for float[N][N][V]"

    Basically I have 4 Nodes (N) and 1 Vehicle (V) and the constant "Ct" is supposed to be the transportation cost between node i in N and j in N for vehicle v in V.

    Ct is defined like this in the .mod file:

    float Ct[i in N, j in N, v in V] = ...;

    and like this in the .dat file:

    Ct = [0.4, 10.2,15.4,1,12.7,14.3,15,14,11,16];

    I attached the .mod and the . dat file.

    Any help is highly appreciated!

    BR,

    Gustav


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Error: Unexpected value in .dat file

    Posted 09/18/17 12:53 PM

    Originally posted by: gustavgans123


    I solved that problem, As I took out the v in V index, as v = 1 anyway at the moment. Also I changed the .dat file to:

    Ct= [

    [40,20,25],

    [40,35,45],

    [20,35,15],

    ];

    But the objective function seems to have several issues, as I get many errors: "opl cannot extract expression "objective function". I attached the updated files.

     

    Again, any help is highly appreciated!

    BR 

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Error: Unexpected value in .dat file

    Posted 09/18/17 01:38 PM

    Hi,

    you simply have an out of bound.

    If you turn

    minimize sum(i in N, j in N, v in V, s in S) Ct[i,j]*y[i,j,v,s] + sum(m in M, v in V, s in S) Cit[v]*x[m,v,s] + sum(m in M, s in S) Clp[m,s]*l[m,s];

    into

    minimize sum(i in N, j in N, v in V, s in S:i!=0 && j!=0) Ct[i,j]*y[i,j,v,s] + sum(m in M, v in V, s in S) Cit[v]*x[m,v,s] + sum(m in M, s in S) Clp[m,s]*l[m,s];
     
     

    your model will work fine

    regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Error: Unexpected value in .dat file

    Posted 09/20/17 03:39 AM

    Originally posted by: gustavgans123


    Hi Alex,

    thank you very much, that saved me a lot of time!

    BR


    #CPLEXOptimizers
    #DecisionOptimization