Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX cannot extract model: IloAlgorithm cannot extract extractable. Help!

    Posted 05/09/12 11:40 AM

    Originally posted by: meletis13forever


    My model is that:

    {string} infrastructure=...;
    {string} terminals=...;

    tuple terminaltuple{
    key string name;
    int x;
    int y;
    int maxBW;
    int availBW1;
    int availBW2;
    int availBW3;
    }
    {terminaltuple} terminaldata=...;
    terminaltuple dummy;

    tuple infratuple{
    key string name;
    int x;
    int y;
    {float} PL;
    float maxPower;
    float cap;
    }
    {infratuple} infradata=...;

    terminaltuple terminalterminals = t in terminaldata ;
    infratuple infrainfrastructure = i in infradata ;

    {float} powers=...;
    float lpowers=...;
    float z=...;

    execute{
    for(var t in terminals){
    dummy.x=100000;
    dummy.y=100000;

    while((infra.x-dummy.x)^2 + (infra.y-dummy.y)^2 >= 500.0){
    dummy.x=875+Opl.rand(30);
    dummy.y=268+Opl.rand(30);
    }
    terminal[t].x=dummy.x;
    terminal[t].y=dummy.y;
    writeln("success adding "terminal[t].name" "terminal[t].x" "+terminal[t].y);
    }
    }

    dvar boolean xterminalsinfrastructure;
    dvar boolean ypowersinfrastructure;
    dvar boolean Nterminalsinfrastructurepowers;
    dvar int bterminals;
    dvar int wterminalsinfrastructure;

    dexpr float Cpj in infrastructure = sum(k in powers) y[k][j] * l[k] * infra[j].maxPower;
    dexpr float covj in infrastructure = 10^((Cp[j]/20) + 1.96);
    dexpr float di in terminalsj in infrastructure = sqrt((terminal[i].x - infra[j].x)^2 + (terminal[i].y - infra[j].y)^2);
    dexpr float loadj in infrastructure = sum(i in terminals) w[i][j];
    dexpr float T1 = sum(j in infrastructure) Cp[j];
    dexpr float T2 = sum(j in infrastructure, j2 in infrastructure : j2!=j) (load[j] - loadj2)^2;
    dexpr float T3 = sum(i in terminals, j in infrastructure, i2 in terminals : i2!=i, j2 in infrastructure : j2!=j) (x[i][j] - xi2j2);
    dexpr float T4 = (1/70) * sum(i in terminals, j in infrastructure) x[i][j] * d[i][j];
    dexpr float T5 = (1/4) * sum(j in infrastructure) (infra[j].cap - load[j])/ infra[j].cap;
    dexpr float T6 = (1/5) * sum(i in terminals) (terminal[i].maxBW - b[i])/terminal[i].maxBW ;

    minimize
    T1 + T2 + T3 + T4 - T5 + T6;

    subject to{

    forall(i in terminals)
    sum(j in infrastructure)
    x[i][j] == 1;

    forall(j in infrastructure)
    sum(k in powers)
    y[k][j] == 1;

    forall(i in terminals, j in infrastructure, k in powers)
    N[i][j][k] <= y[k][j];

    forall(i in terminals, j in infrastructure, k in powers)
    x[i][j] <= N[i][j][k] * y[k][j];

    forall(i in terminals)
    b[i] <= terminal[i].maxBW;
    forall(j in infrastructure)
    load[j] <= z * infra[j].cap;

    forall(i in terminals)
    b[i] == terminal[i].availBW1 || b[i] == terminal[i].availBW2 || b[i] == terminal[i].availBW3;
    forall(i in terminals, j in infrastructure)
    w[i][j] <= 1024 * x[i][j];

    forall(i in terminals, j in infrastructure)
    w[i][j] >= 64 * x[i][j];

    forall(i in terminals, j in infrastructure)
    w[i][j] <= (b[i] - 64 * (1 - x[i][j]));

    forall(i in terminals, j in infrastructure)
    w[i][j] >= (b[i] - 1024 * (1 - x[i][j]));

    forall(i in terminals, j in infrastructure)
    sum(j in infrastructure) x[i][j] * d[i][j] <= cov[j];

    }
    I don't have a mistake in syntax but when I run the model I get this errors:

    CPLEX(default) cannot extract expression: 10^(Cp[j] / 20+1.96)
    CPLEX(default) cannot extract expression: forall(i in terminals, j in infrastructure) sum(j in infrastructure) x[i][j]*d[i][j] <= cov[j]
    CPLEX(default) cannot extract model: IloAlgorithm cannot extract extractable

    Also the expression 10^(Cp[j] / 20+1.96) has not have any problem before I add the constraint:

    forall(i in terminals, j in infrastructure)
    sum(j in infrastructure) x[i][j] * d[i][j] <= cov[j];

    This constraint has the problem but it is not syntax. Can you help me?
    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: CPLEX cannot extract model: IloAlgorithm cannot extract extractable. Help!

    Posted 05/10/12 04:29 AM

    Originally posted by: SystemAdmin


    The problem is
    
    dexpr 
    
    float cov[j in infrastructure] = 10^((Cp[j]/20) + 1.96);
    

    which expands to
    
    dexpr 
    
    float Cpj in infrastructure = ; dexpr 
    
    float cov[j in infrastructure] = 10^(((sum(k in powers) y[k][j] * l[k] * infra[j].maxPower)/20) + 1.96);
    

    Since y is a decision variable you end up with an expression that has decision variables in its exponent. That is not supported by the CPLEX solver engine and therefore you get an exception when you try to solve the model.
    You did not get an exception before because you were not using cov in any of the constraints and so the solver engine never saw the offending expression.
    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: CPLEX cannot extract model: IloAlgorithm cannot extract extractable. Help!

    Posted 05/10/12 12:07 PM

    Originally posted by: meletis13forever


    Thanks for the quick reply. Is there any other way to express the cov (coverage)? Or I have to add the coverage in data and the cplex only do the comparison in the constraint blog?
    #DecisionOptimization
    #MathematicalProgramming-General


  • 4.  Re: CPLEX cannot extract model: IloAlgorithm cannot extract extractable. Help!

    Posted 05/27/12 09:32 AM

    Originally posted by: meletis13forever


    I find the solution to this problem. I created an array for coverage in the dat file and removed the dvar N[i][k][j] and the model is running! But when I change the data and more specific the coordinates in bs,femtocell I get again an error. I have already post a new thread for this problem!
    #DecisionOptimization
    #MathematicalProgramming-General