Originally posted by: Puppy26
Hi Alex,
Here is the code
dvar int CSSupply [Consignees][Shippers][Years];
dvar int SCSupply [Shippers][Consignees][Years];
dvar float StreetTurnPct [Years];
dvar float StreetTurnPctsh [Years];
forall ( y in Years)
Streetturnvalue:
StreetTurnPct[y] == sum (c in Consignees, s in Shippers) SCSupply[s][c][y]/Demand[y];
forall (y in Years)
Streetturnvalueb:
StreetTurnPctsh[y] == sum (c in Consignees, s in Shippers) CSSupply[c][s][y]/Supply[y];
forall (y in Years) 0 <= StreetTurnPct[y] <= 0.2;
forall (y in Years) 0 <= StreetTurnPctsh[y] <= 0.2;
forall (y in Years)
Equity:
sum (c in Consignees, s in Shippers) SCSupply[s][c][y] == sum (c in Consignees, s in Shippers) CSSupply[c][s][y];
In the place of Demand in StreetTurnPct[y], it has to be Demand[y] - ShipperRejects [y].. Since the Demand[y] and ShipperRejects[y] both are variable, im getting error as "OPL cannot extract the expression".
Many thanks!
#DecisionOptimization#OPLusingCPLEXOptimizer