Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to remove an element from a tuple?

    Posted 05/22/13 12:26 PM

    Originally posted by: J0FR_Victor_Pereira


    Hello,

    I am running my optimization model inside a script in cplex. In my model file, I have a tuple "D" and an array called "Dmnd[D]". I want to find a specific element in D, say "d", then delete such element from set D and the corresponding Dmnd[d] array element. I can add elements easily enough using the keyword "add", but I am having trouble deleting.

    My script is pretty long, but this is the relevant part:

    (...)
    if (MyDataElements.Dmnd[d] != DemandStar[z]) {
         MyDataElements.Dmnd[d].remove;
         MyDataElements.D.remove(d);
    }
    (...)

    Any help is greatly appreciated!


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: How to remove an element from a tuple?

    Posted 05/22/13 07:22 PM

    You may get an answer faster by asking on the OPL forum.

    Paul


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: How to remove an element from a tuple?

    Posted 05/22/13 10:31 PM

    Originally posted by: XingLi


    Hi,

    I have an idea might work, but increase the computing operations...say like we use "add" here, add all the elements != d in D into a new D', use D' further. 

    Bests, =)


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: How to remove an element from a tuple?

    Posted 05/22/13 10:31 PM

    Originally posted by: XingLi


    Hi,

    I have an idea might work, but increase the computing operations...say like we use "add" here, add all the elements != d in D into a new D', use D' further in ur code. 

    Bests, =)


    #CPLEXOptimizers
    #DecisionOptimization