Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Changing format of a Tuple Set

    Posted 10/28/20 04:15 PM
    I have a tuple like:
    tuple tupX
    {
    string WhseID;
    }
    and I have a tuple set like
    {tupX} Set={<"04"> <"05"> <"07"> }
    What I want is something like:
    {"04", "05","07", "08"}

    I am not sure what type of data structure it is but how can I reach from my Set to the above format? 




    ------------------------------
    Armaghan Alibeyg
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Changing format of a Tuple Set

    Posted 10/28/20 05:12 PM
    Hi

    tuple tupX
    {
    string WhseID;
    }

    {tupX} Set={<"04">, <"05">, <"07"> };

    {string} s={i.WhseID | i in Set};

    execute
    {
    writeln(s);
    }


    /*

    which gives

    {"04" "05" "07"}

    */

    regards

    ------------------------------
    ALEX FLEISCHER
    ------------------------------



  • 3.  RE: Changing format of a Tuple Set

    Posted 10/29/20 08:49 AM
    Hi Alex,
    Thanks for the reply however I am looking for {"04", "05", "07"} instead of {"04" "05" "07"}.  (Commas in between)

    ------------------------------
    Armaghan Alibeyg
    ------------------------------



  • 4.  RE: Changing format of a Tuple Set

    Posted 10/29/20 09:43 AM
    Hi

    then I would use scripting:


    tuple tupX
    {
    string WhseID;
    }

    {tupX} Set={<"04">, <"05">, <"07"> };

    {string} s={i.WhseID | i in Set};

    execute
    {
    writeln(s);

    write("{");
    for(var i in s)
    {
    write("\"",i,"\"");
    if (Opl.last(s)!=i) write(",");
    }
    writeln("}");
    }

    which gives



    {"04" "05" "07"}
    {"04","05","07"}

    ------------------------------
    ALEX FLEISCHER
    ------------------------------