Decision Optimization

Decision Optimization

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


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

    Posted 08/28/20 01:06 AM

    Hi,

    This task took a lot of time, so I wanted to share how I sorted out.

    Look at the example:

    tuple dataMaeStations {

    key string stations;

    float price;

    };

    {dataMaeStations} infoMaeStations = {<"s1", 1>, <"s2",2>};

    //Modify programatically the value of an element in a tuple set

    execute{

    infoMaeStations.find("s1").price = 5;

    writeln(infoMaeStations);

    }

    //This prints the updated tuple set infoMaeStations {<"s1" 5> <"s2" 2>}

    //Another way

    execute{

    infoMaeStations.find("s1",5).price = 10;

    writeln(infoMaeStations);

    }

    //This prints the updated tuple set infoMaeStations {<"s1" 10> <"s2" 2>}






    #DecisionOptimization
    #Support
    #SupportMigration


  • 2.  RE: How to modify an element from a tuple set?
    Best Answer

    Posted 08/28/20 01:07 AM

    Look at the example:

    tuple dataMaeStations {

    key string stations;

    float price;

    };

    {dataMaeStations} infoMaeStations = {<"s1", 1>, <"s2",2>};

    //Modify programatically the value of an element in a tuple set

    execute{

    infoMaeStations.find("s1").price = 5;

    writeln(infoMaeStations);

    }

    //This prints the updated tuple set infoMaeStations {<"s1" 5> <"s2" 2>}

    //Another way

    execute{

    infoMaeStations.find("s1",5).price = 10;

    writeln(infoMaeStations);

    }

    //This prints the updated tuple set infoMaeStations {<"s1" 10> <"s2" 2>}






    #DecisionOptimization
    #Support
    #SupportMigration