Originally posted by: JaneM
Here's another one that I can't figure out that seems related to the same notation.
dexpr float ZLWS_Use[l in LOC1][t in TimeE] =
sum(gl in AssignT:gl.Loc1Name==l.LOC1) (ZPG_WSOcc[gl][t] * (1 + BufferG[gl.PGLevel2ID][t])) ;
BufferG is defined as
BufferG[PlGroups][TimeT]
I want to use BufferG for the g that is in gl
The error is:
Cannot use type string for <PGLevel2ID:string>
I tried this which worked. But I don't think I should have to use a sum when I am just trying to find the one g that equals gl.PGLeve2ID. I'm not even sure if it is doing the right calculation.
dexpr float ZLWS_Use[l in LOC1][t in TimeE] =
sum(gl in AssignT:gl.Loc1Name==l.LOC1)
(ZPG_WSOcc[gl][t] * (1 + sum(g in PlGroups: gl.PGLevel2ID == g.PGLevel2ID) BufferG[g][t])) ;
Similary this doesn't work
forall (g in PlGroups, t in TimeE)
ctAssignAll: sum(gl in AssignT:gl.PGLevel2ID==g) ZPGShLoc1[gl][t] == 1;
Based on an example above that worked for an expression
dexpr float ZLWS_Occ[l in LOC1][t in TimeE] =
sum(gl in AssignT:gl.Loc1Name==l.LOC1) ZPG_WSOcc[gl][t] ;
I tried
forall (g in PlGroups, t in TimeE)
ctAssignAll: sum(gl in AssignT:gl.PGLevel2ID==g.PlGroups) ZPGShLoc1[gl][t] == 1;
That has the error
Expecting a component in tuple <PGLevel2ID:string>, found PlGroups.
So tried this, which worked
forall (g in PlGroups, t in TimeE)
ctAssignAll: sum(gl in AssignT:gl.PGLevel2ID==g.PGLevel2ID) ZPGShLoc1[gl][t] == 1;
I don't understand why in one case, the index is followed by the name of the set (l.LOC1) and in this case, the name of the set doesn't work (g.PlGroups), it works when followed by the field name in the index gl, g.PGLevel2ID.
Overall, I don't understand why CPLEX has set up the DOCloud version so that what works on a desktop perpetual license doesn't work in the cloud.
#DecisionOptimization#OPLusingCPLEXOptimizer