Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  cannot extract expression

    Posted 07/08/15 06:01 AM

    Originally posted by: ouaigooo


    Hi,

    I've got a dexpr in the objective function that I cannot access after solving.

    When running the model file below (details ommitted), OPL crashes when invoking "writeln("profit_scenario: ", profit_scenario);", with the following error

    OPL cannot extract expression: profit_scenario

    How come ?

    Has it something to do with model simplifications that CPLEX performs before solving ? Can we switch them off ?

    Thanks for your help !

     

    model file:

    ...


    {string} MARKET_NAMES =
        ({x.name | x in PRICES_MAPPING} inter {x.name | x in PRICE_PEX})
        union
        ({x.name | x in PRICES_MAPPING_RES} inter {x.name | x in PRICE_RES});
    dexpr float profit_market[y in MARKET_NAMES, i in SCENARII] =
        sum(x in PRICE_PEX: x.name==y) x.value*power_PEX[i,x]*item(PRICES_MAPPING,<x.name>).sign*(x.stop-x.start)/3600
        + ((WITH_RES==0) ? 0 : sum(x in PRICE_RES: x.name==y) x.value*power_RES[i,x]);
        
    {string} OBJ_FCT_COMPONENTS = MARKET_NAMES union
        {"network","storage","building","min/max on/off","forced","legio","final"};
        
    dexpr float obj_fct_components[y in OBJ_FCT_COMPONENTS][i in SCENARII] =
        (y == "network") ? sum(x in NETWORK_COSTS) network_cost[i,x] :
        (y == "storage") ? -sum(x in STORAGES) penalty_storage[x,i] :
        (y == "building") ? -sum(x in BUILDINGS) penalty_building[x,i] :
        (y == "min/max on/off") ? -sum(x in PMMOO_SOFT) penalty_PMMOO[x,i] :
        (y == "forced") ? -penalty_forced_schedule :
        (y == "legio") ? -sum(x in BOILERS_legio) penalty_legio[x,i] :
        (y == "final") ? value_final_state[i] :
        (y == "legio") ? sum(x in NETWORK_COSTS) network_cost[i,x] :
        (y in MARKET_NAMES) ? profit_market[y,i] :
        0;

    dexpr float profit_scenario[i in SCENARII] = sum(x in OBJ_FCT_COMPONENTS) obj_fct_components[x,i];

    maximize sum(i in SCENARII) SCENARIO_WEIGHT[i]*profit_scenario[i];

    subject to { ... }

    float ps[i in SCENARII] = 0;
    execute {
    for (var i in SCENARII) for (var x in OBJ_FCT_COMPONENTS) ps[i] += obj_fct_components[x][i];
        writeln("obj_fct_components: ", obj_fct_components);
        writeln("ps: ", ps);
        writeln("profit_scenario: ", profit_scenario);
    }


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: cannot extract expression

    Posted 07/10/15 01:53 PM

    Hi

    can you attach a .dat so one coukd try ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: cannot extract expression

    Posted 07/20/15 04:36 AM

    Originally posted by: ouaigooo


    sorry, data+model are confidential. Should I start a service request instead ?


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: cannot extract expression

    Posted 07/20/15 11:27 AM

    Hi

    yes, then somebody from our support will have a look

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: cannot extract expression

    Posted 02/24/16 01:22 PM

    Originally posted by: Thomas_321


    Hey, 

    where can you start a service request regarding questions/problems concerning Cplex OPL?

     

    Thanks and best regards!


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: cannot extract expression

    Posted 02/25/16 02:00 AM