Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  sutracting number from IloNumExpr java cplex

    Posted 02/21/13 09:02 AM

    Originally posted by: SystemAdmin


    Hello! What I want to do is to subtract an IloNumExpr from a number. I want to put to an expression the following thing:
    \{
    for i
    for j
    for k
    n-(n-k-1)*y[i][j]
    \}
    n is an integer and y is a decision variable

    Cplex does not let me subtract a number in the addTerm method of the expression.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: sutracting number from IloNumExpr java cplex

    Posted 02/21/13 09:17 AM

    Originally posted by: SystemAdmin


    You need to use the setConstant() member function to change the constant part of an expression.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: sutracting number from IloNumExpr java cplex

    Posted 02/21/13 09:29 AM

    Originally posted by: SystemAdmin


    Thanks, Daniel. But then how will I subtract the expression from this constant part. I will say \{setConstant(n) \} and how will I say the \{ -(n-k+1)y[i][j] \}?
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: sutracting number from IloNumExpr java cplex

    Posted 02/21/13 09:42 AM

    Originally posted by: SystemAdmin


    I suggest you take a good look at the IloCplexModeler class reference documentation. That is the superclass of IloCplex that provides the modeling API.
    There you can find for example member function
    IloNumExpr sum(double v, IloNumExpr e1);
    

    that produces the sum of a constant and an expression.
    #CPLEXOptimizers
    #DecisionOptimization