Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  ITupleMap

    Posted 05/15/08 04:35 PM

    Originally posted by: SystemAdmin


    [shadi said:]

    hello...
    i have the following definition of the upleMap MybusCategoryIdx:

    ILOG.Concert.ITupleMap MybusCategoryIdx=oplCP.GetElement("busCategoryIdx").AsTupleMap();

    how i can get one tuple of this TupleMap ??



    thank you
    Kshieboun Shadi

    #ConstraintProgramming-General
    #DecisionOptimization


  • 2.  Re: ITupleMap

    Posted 05/15/08 07:01 PM

    Originally posted by: SystemAdmin


    [arnaud.schulz said:]

    Hi,

    To get a tuple from the tuple map you could do:


    tuple T {
    int a;
    int b;
    };

    T toto[ i in 1..3 ][ j in 10..13 ] = <i, j*2>;



        ITupleMap tupleMap = opl.GetElement( "toto" ).AsTupleMap();

        IMapIndexArray indexArray = oplF.MapIndexArray( 0 );
        indexArray.Add( 1 );
        indexArray.Add( 12 );

        // Before calling ITuple.GetAt(...), you must use ITuple.MakeTuple()
        // to create an empty tuple
        ITuple tuple = tupleMap.MakeTuple();
        tupleMap.GetAt( indexArray, tuple );


    Arnaud.
    #ConstraintProgramming-General
    #DecisionOptimization


  • 3.  Re: ITupleMap

    Posted 05/15/08 07:14 PM

    Originally posted by: SystemAdmin


    [afleischer said:]

    Hi,

    let me give you a C++ example:

    if you have in your .mod

    tuple t
    {
    int a;
    int b;
    }

    {string} r={"Monday","Tuesday"};
    t s[r]=[<1,2>,<2,3>];

    then to read the s for Tuesday you could write

    IloTupleMap s= opl.getElement("s").asTupleMap();
    IloMapIndexArray ids(env, 0);
    ids.add("Tuesday");
    IloTuple res = s.makeTuple();
    s.getAt(ids, res);
    cout << res << endl;<br />
    which gives

    <2,3>

    Hope this helps

    #ConstraintProgramming-General
    #DecisionOptimization