Hi,
tuple Raw
{
key int Rawtype;
float Rawamount;
}
tuple t
{
int Rawtype;
float Rawreq;
}
{Raw} RawAvail = {<1,2.0>,<2,3.0>};;
{t} Rawperprocess ={<1,3.0>,<1,4.8>,<2,3.0>};
dexpr float rawConsume[r in RawAvail] = sum ( dr in Rawperprocess:dr.Rawtype == r.Rawtype)(dr.Rawreq*1000);
subject to
{
}
execute
{
writeln(rawConsume);;
}
gives
[7800 3000]
regards
#DecisionOptimization#OPLusingCPLEXOptimizer