Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Run cplex concert application several times with different objective function?

  • 1.  Run cplex concert application several times with different objective function?

    Posted 08/01/08 07:11 PM

    Originally posted by: SystemAdmin


    [namsu said:]

    Dear,

    I need to run LP with different objective function coefficients.
    That is, constraints are the same.

    For example,

    at first try,
    max: x1+x2+x3

    second try
    max: 2x1+x3

    third try
    max: 5x1+x2

    ..

    the constraints parts are still the same.

    I tried to implement as follows:

    while( 1 ) {

    IloExpr masterObj(env);

    for (int ct=0; ct<sizeC; ct++) {<br />
    //detail parts are omitted

    masterObj += ( ( (rand()%1000)+1-200 ) * c[i][j][d] );

    }//end of master obj

    masterM.add(IloMaximize(env, masterObj));
    cplexM.solve();

    masterM.remove(IloMaximize(env, masterObj));
    masterObj.end();

    }


    Compile, and link were ok.
    however, when I run the program, I got the below error message.

    Error: MultipleObjException: IloCplex can not handle multiple objectives

    Any one knows how to cover this error?

    Your help will be very appreciated.
    thanks for reading.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Run cplex concert application several times with different objective functio

    Posted 08/01/08 08:39 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    You're not actually deleting the previous objective -- each call to IloMaximize creates a new objective, so you are trying to delete a new objective you never added.  I'm surprised it doesn't throw an exception.

    Try

    IloObjective obj = IloMaximize( ... );
    masterM.add(obj);
    ...
    masterM.remove(obj);
    #CPLEXOptimizers
    #DecisionOptimization