Originally posted by: ikucukkoc
Hello. I have a question about conditional filtering in tuples. For example I have a tuple like:
TaskTimes = {
<1 A 1 L 3>,
<1 A 2 R 3>,
<1 A 3 E 0>,
<2 A 4 L 2>,
<2 A 5 E 1>,
};
And I want to obtain following tuple:
TaskTimes = {
<1 A 1 L 15>,
<1 A 2 R 15>,
<1 A 3 E 0>,
<2 A 4 L 6>,
<2 A 5 E 3>,
};
I want to multiply the "pt" column with "5" if "h=1"; multiply with "3" if "h=2".
I can do that using for and if loops but it is not good for large sized tuples in terms of computation time. I am sure that there should be an easier way.
Appreciate for your help in advance.
Kind Regards.
#DecisionOptimization#OPLusingCPLEXOptimizer