Decision Optimization

Decision Optimization

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

 View Only
  • 1.  OPL cannot extract expression

    Posted Mon March 28, 2022 09:02 AM
    // Declaration of data

    int depot = ...; range D = 1..depot;
    int satellites = ...; range S = depot+1..depot+satellites;
    int customers = ...; range C = depot+satellites+1..depot+satellites+customers;
    int ds = ...; range DS = 1..ds;
    int sc = ...; range SC = depot+1..depot+sc;
    int dsc = ...; range DSC = 1..dsc;
    int o = ...; range O = depot+satellites+customers..depot+satellites+customers+o;
    int dsco = ...; range DSCO = 1..dsco;


    int t = ...; range T = 1..t;
    int v = ...; range V = t+1..t+v; range TV = 1..t+v;
    int Ft = ...;
    int Fv = ...;
    int allocation[C] = ...;
    int demand[C] = ...;
    int M = ...;
    int service[DSCO] = ...;
    int sat_cap[S] = ...;

    float cost[DSCO][DSCO] = ...;

    dvar boolean R[DS][DS][T];
    dvar boolean U[TV];
    dvar boolean Y[C][TV];
    dvar boolean Q[C][S];
    dvar boolean X[SCO][SCO][V];

    dvar boolean B[V][S];
    dvar float L[CO][V];
    dvar float G[S][T];
    dvar boolean K[V][O];

    minimize sum(t in T, i in DS, j in DS)(cost[i, j] * R[i, j, t]) + sum(t in T)(U[t] * Ft) + sum(v in V, i in SCO, j in SCO)(cost[i, j] * X[i, j, v]) + sum(v in V)(U[v] * Fv);

    subject to{

    forall(c in C){
          forall(v in V){
                   M * (3 - Q[c, 1] - Y[c, v] - B[v, 2] - B[v, 3] - B[v, 4]) + sum(o in O)(K[v, o]) >= 1;
                }
            }
    }

    There is no non linearity involved in the constraint but still the opl is giving error
    please help

    ------------------------------
    Sagar Pingale
    ------------------------------

    #DecisionOptimization


  • 2.  RE: OPL cannot extract expression

    Posted Mon March 28, 2022 09:45 AM
    Hi,
    I wanted to do a quick check by copy-pasting your OPL model in my COS IDE.
    There are some errors because of some missing symbols ("CO" and "SCO"). I suspect "SCO" should be "DSCO" because of the definition of the constraint using "cost" and "X"...
    Could you specify what kind of OPL errors you got ?
    Best regards,
    Hugues

    ------------------------------
    Hugues Juille
    ------------------------------