Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  how to assign an expression to a variable

    Posted 11/27/10 09:34 AM

    Originally posted by: QINGQINGQING


    dear all,

    I am now using cplex on java to implement a model, and I would like to assign

    t[i]+t[j]

    to a certain variable

    x

    ,
    now I do not know how to handle it and ask for your help.

    Thank you
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: how to assign an expression to a variable

    Posted 11/27/10 11:38 AM

    Originally posted by: SystemAdmin


    Have you looked at the various examples that ship with CPLEX? I think reviewing the source code would help to answer some of your questions.

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: how to assign an expression to a variable

    Posted 11/27/10 12:20 PM

    Originally posted by: QINGQINGQING


    how about assign

    IloNumVar

    t[i]*t[j]

    to

    x

    ?
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: how to assign an expression to a variable

    Posted 11/27/10 02:30 PM

    Originally posted by: QINGQINGQING


    IloNumVar][[] x=new IloNumVar[D][D][K];//x_ijk is bool
    double interval=Integer.MAX_VALUE+travelling_time+service_time
    now I want to asign

    -Integer.MAX_VALUE+x[i][j][k]*interval

    to a certain variable, such as

    var
    then I want to add the constraint

    t[i]+var<t[j]//t[i] and t[j] are both time

    into the cplex model
    Thank you
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: how to assign an expression to a variable

    Posted 11/29/10 04:29 AM

    Originally posted by: SystemAdmin


    You can build up any kind of (linear) expression using functions cplex.sum(), cplex.prod(), cplex.diff(). Or just use addTerm() of IloLinearNumExpr.
    Please also refer to chapter "ILOG Concert Technology for Java users" in the user manual. It should answer all the questions you are posting here.
    #CPLEXOptimizers
    #DecisionOptimization