Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Change a parameter in the objective function

    Posted 07/13/21 11:28 AM
    Hello,

    I have a bi-objective problem and I am going to use Nadir point to normalize the objective and then change the lambda parameter from 0.1 to 0.9 to get the pareto-optimal. Could you please help me with the errors in the screenshot?


    Best regards,

    ------------------------------
    Siamak Mushakhian
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Change a parameter in the objective function

    Posted 07/13/21 11:43 AM
    You can modify the objective only via changing the coefficients of variables.
    See https://www.ibm.com/docs/api/v1/content/SSSA5P_20.1.0/ilog.odms.ide.help/refjsopl/html/IloObjective.html#setCoef

    I guess that f1_normal is a dexpr and not a variable.
    If so, you may insert variables, use them in the objective and make them equal to the dexpr?

    ------------------------------
    Vincent Beraudier
    ------------------------------



  • 3.  RE: Change a parameter in the objective function

    Posted 07/13/21 12:32 PM
    Yes, you are right. It is a dexpr but unfortunately, I didn't get your point. How can I change it to a dvar?
    Here you can find the f1_normal where f1 is another dexpr, but f1_optimal and f1_nadir are parameters (as I already know their values).

    Would you mind if you provide me a simple example?

    ------------------------------
    Siamak Mushakhian
    ------------------------------



  • 4.  RE: Change a parameter in the objective function

    Posted 07/15/21 06:11 AM
    You optimize 2 goals, which are complex expressions, and want to change their coefs.
    As obj.setCoef only deals with variables, you need to use 2 variables in the objective, and add 2 constraints in the subject-to to make them equal to the variables.

    A very simple example:
    <code>

    int N = 5;

    range R = 0..5;

    {float} coefs = { i/N | i in R}; 

    float coef1 = 1;

    dvar int X[R] in 0..1;

    dvar int Y[R] in 0..1;

    dexpr float exp1 = sum(i in R) item(coefs,i)*X[i];

    dexpr float exp2 = sum(i in R) item(coefs,i)*Y[i];

    // obj.setCoef only deals with variables, not dexpr => Need an indirection.

    dvar float goal1;

    dvar float goal2;

    maximize coef1 * goal1 + (1-coef1) * goal2;

    subject to{

      // force the dexpr to be == to the vars.

      goal1 == exp1;

      goal2 == exp2;    

      

      exp1 <= 2.5;

      exp2 <= 1.5;

    }

    main{

      thisOplModel.generate();

      for (var c in thisOplModel.coefs){

        thisOplModel.getObjective().setCoef(thisOplModel.goal1, c);

        thisOplModel.getObjective().setCoef(thisOplModel.goal2, 1-c);

        cplex.solve();

        thisOplModel.postProcess();

        writeln("New Objective for threshold "+c + " is "+ thisOplModel.getObjective().solutionValue);

      }

    }
    </code>

    It will produce:
    <code>

    New Objective for threshold 0 is 1.4

    New Objective for threshold 0.2 is 1.6

    New Objective for threshold 0.4 is 1.8

    New Objective for threshold 0.6 is 2

    New Objective for threshold 0.8 is 2.2

    New Objective for threshold 1 is 2.4
    </code>



    ------------------------------
    Vincent Beraudier
    ------------------------------



  • 5.  RE: Change a parameter in the objective function

    Posted 07/15/21 08:23 PM
    Thank you so much for your comprehensive expalantion. 

    Best regards,

    ------------------------------
    Siamak Mushakhian
    ------------------------------