Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

deleting tuple from set of tuples

  • 1.  deleting tuple from set of tuples

    Posted Sat January 24, 2009 11:10 AM

    Originally posted by: SystemAdmin


    [shadi said:]

    how i can delete a tuples from a set of tuples ??
    i mean if i have the following structure:

    tuple pairCst_T {
      int i;
      int v;
      int bc;
      int DrivingTime;
      int DrivingDistance;
      int BreakTime;
      int DutyPeriod;

    };
    {pairCst_T} pairCst = {};

    1. how i can delete from pairCst the tuple that has i equal to 200??

    2. if there was more that one tuple (with i=200) how i can delete all these tuples??

    thanks in advanced
    Kshieboun Shadi

    #ConstraintProgramming-General
    #DecisionOptimization


  • 2.  Re: deleting tuple from set of tuples

    Posted Tue February 10, 2009 05:42 PM

    Originally posted by: SystemAdmin


    [afleischer said:]

    what you could try is

    {int} indexes={ ord(pairCst,x) | x in pairCst: x.i==200};
    {pairCst_T} s={ x | x in pairCst: x.i==200};

    {pairCst_T} pairCst2={ item(pairCst,i)
    | i in 0..card(pairCst)-1 : i not in indexes };

    execute
    {
    pairCst=pairCst2;
    writeln(pairCst);
    }

    Alex
    #ConstraintProgramming-General
    #DecisionOptimization