Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How do I extract a nested tuple from an IloTuple?

    Posted 09/18/08 12:43 AM

    Originally posted by: SystemAdmin


    [alan_a said:]

    This is a Java app, using a model developed in OPL, running CPLEX.

    IloTupleSet mySet = opl.getElement("mySet").asTupleSet();
    for (Iterator it1 = mySet.iterator(); it1.hasNext();){
        IloTuple oneofMySet = (IloTuple) it1.next();

    Now given that the definition of oneofMySet would read as follows (in OPL)
    tuple oneofMySet{
    tuple_i_defined t1;
    tuple_i_defined_also t2;
    int someNumber;
    }

    How do I extract t1 and t2 so that I can do something useful with them?

    TIA, Alan
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How do I extract a nested tuple from an IloTuple?

    Posted 09/18/08 01:08 AM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    Hi,

    you  might look at :

    IloTuple makeTupleValue(java.lang.String col)
              Creates and returns the IloTuple value of the given column of the invoking tuple.

    with col = "t1"

    Alain
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: How do I extract a nested tuple from an IloTuple?

    Posted 09/18/08 04:54 PM

    Originally posted by: SystemAdmin


    [alan_a said:]

    Here's the online help for that function

    [b]makeTupleValue[/b]
    IloTuple makeTupleValue(java.lang.String col)


    Not exactly verbose, is it?
    If it had said "getTupleValue" I'd have tried it, just as I tried a dozen other functions.
    "make" implies construction, not retrieval (at least to me).

    With that said, it does exactly what I need it to.
    I appreciate the help.
    Alan

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: How do I extract a nested tuple from an IloTuple?

    Posted 09/18/08 07:33 PM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    Hi,

    it is "make", as the structure returned (IloTuple) needs to be created.
    "get" is used for basic type where no such structure is created.

    Alain
    #DecisionOptimization
    #OPLusingCPLEXOptimizer